Charmed Quark Systems, Ltd. - Support Forums and Community
Basic Debugging Question - Printable Version

+- Charmed Quark Systems, Ltd. - Support Forums and Community (https://www.charmedquark.com/vb_forums)
+-- Forum: General Discussion (https://www.charmedquark.com/vb_forums/forumdisplay.php?fid=3)
+--- Forum: CQC Support (https://www.charmedquark.com/vb_forums/forumdisplay.php?fid=9)
+--- Thread: Basic Debugging Question (/showthread.php?tid=10450)



Basic Debugging Question - RichardU - 12-20-2017

I'm trying to do some basic debugging of a Global Action. Now that I'm in 5.x I need to update my methods. 

So what is the preferred way to indicate how conditionals are being evaluated?

For example:

If something ...
    tell me that this evaluated as true
    if something else ...
        tell me that this evaluated as true
    end
end

Thanks, Richard


RE: Basic Debugging Question - batwater - 12-20-2017

for logging I use the System::LogMsg() command and I have an if statement that checks to see if a debugging variable is set. I use a VarDriver Boolean variable called debug so that I can change it on the fly. I use the same method for "special" debugging code to do whatever when I'm developing something. Easy to turn on or off.

Thus: (simplest form)

If debug then System::LogMsg()

or

If debug

do some things

end if

Typically debug statements go inline with the code so that conditions are evaluated as I've designed, debug is turned on when I need to validate whether I'm getting the expected result or not or for other diagnostic info. Personally I do not put a separate evaluation in in order to debug said evaluation, it's built into the flow of the code. Make sense?


RE: Basic Debugging Question - Dean Roddey - 12-20-2017

For global actions, you can just directly debug it using the action trace. It will show you everything expanded out.


RE: Basic Debugging Question - RichardU - 12-20-2017

Yes. Makes perfect sense. Thank you for replying. Part of my problem was not knowing how to save global actions. I'll make a separate post about that.

Richard


RE: Basic Debugging Question - RichardU - 12-20-2017

(12-20-2017, 09:27 AM)Dean Roddey Wrote: For global actions, you can just directly debug it using the action trace. It will show you everything expanded out.

Could you provide a hint on where to find Action Trace? I searched through every page of the Actions reference docs, tried a google search and looked at every option in logs.

Also is there any way to see two tabs from the Admin Interface at the same time? Separate instances?

Finally, the Admin Interface shows System / Explore Logs, but when you actually open it, the Tab is labeled Query Logs. Seems inconsistent to me, but you might have some reason for it.

Thanks,

Richard


RE: Basic Debugging Question - Dean Roddey - 12-20-2017

There's a Test button in the lower right. That invokes the action trace window that lets you test the action.

If you want to see live log output, not just do queries, then use the Log Monitor which is a separate program in the Start Menu.


RE: Basic Debugging Question - RichardU - 01-19-2018

Thanks, Dean. I'm also enjoying Batwater's scheme.

I have a codeblock that goes at the top of every action, including a debug variable. While I'm at it, I also define a variable LVar:This which is set to the name of the Action. Then in each of my LogMsg sections I can easily identify which action is prducing the message.


RE: Basic Debugging Question - RichardU - 02-21-2018

FWIW I'm enjoying another form of debug. I have a Global Action: Test. In it I have a variety of tests that mostly write to the log server. I group them as needed and wrap each group with: If System:Equals(1, 1)

To turn on/off any group of tests, I can just change the If System:Equals from 1 to 0 and that group will not fire.