Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Debugging Question
#1
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
My Other web server is Dropbox.
Reply
#2
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?
Reply
#3
For global actions, you can just directly debug it using the action trace. It will show you everything expanded out.
Dean Roddey
Explorans limites defectum
Reply
#4
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
My Other web server is Dropbox.
Reply
#5
(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
My Other web server is Dropbox.
Reply
#6
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.
Dean Roddey
Explorans limites defectum
Reply
#7
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.
My Other web server is Dropbox.
Reply
#8
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.
My Other web server is Dropbox.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SSL Certificate Question gReatAutomation 1 900 10-26-2020, 07:48 AM
Last Post: gReatAutomation
  V2 Question - OpenWeatherMap Using their New JSON Data Feed kblagron 7 2,087 05-07-2020, 01:40 PM
Last Post: Dean Roddey
  Dynamic Overlay Question bryanb 4 1,315 04-17-2020, 03:48 AM
Last Post: bryanb
  Triggered Event on Timer Question znelbok 7 3,354 12-09-2019, 02:10 PM
Last Post: znelbok
  Question on CQC Driver Pack Install kblagron 1 1,260 11-26-2019, 06:38 PM
Last Post: Dean Roddey
  SONOS Driver Question gReatAutomation 13 5,529 08-23-2019, 12:37 PM
Last Post: Dean Roddey
  Insteon V2 Driver Question kblagron 1 1,234 08-01-2019, 10:51 AM
Last Post: kblagron
  Question on Parsing a String in a CML Macro kblagron 2 1,601 06-18-2019, 06:21 PM
Last Post: Dean Roddey
  ELK M1 Client Interface question lleo 1 1,294 06-12-2019, 08:15 AM
Last Post: Dean Roddey
  Question on Socket Error kblagron 4 2,217 04-07-2019, 09:19 PM
Last Post: kblagron

Forum Jump:


Users browsing this thread: 1 Guest(s)