How to add debug output or logging


#1

Can someone shed some light on how to add debug output lines to my code?

I see some sample code snippets with lines like:
debug.log
Log "debug output here"

Thanks!


#2

@webCoRE_Minions


#3

Create a new action:

With location > Log to console


#4

Thanks! I see this option now.

And looks like there is a Wiki page that explains which types of logging (error, info, debug, etc.) appear in which logging mode.

https://wiki.webcore.co/WebCoRE_Logging

None - only error and warning messages will be displayed
Minimal - only error, warning, and info messages will be displayed
Medium - only error, warning, info and trace messages will be displayed
Full - all messages will be displayed (error, warning, info, trace, and debug)

#5

Yeah, I see that too…

But what’s the difference between the various types?

The options are: info, trace, debug, warn, error

Do those changer the behavior in any way or maybe label things differently?

Maybe the Wiki page should be updated with that information.


#6

Haven’t used the debug, warn, and error options, but the trace option will log your messages even with logging turned off … it’s a good way to reduce unwanted messages and keep info to a bare minimum ---- programmer style (trace). I normally have logging turned off in all my pistons, but I do have trace statements scattered within the piston just to be sure the piston is branching to the right places.


#7

Warn appears in the logs with red text… just experiment and you’ll see what the others do.