Debug Mode

I’m used to switch on/off debug mode just to test sql statements but should be nice to use this setting alto to display personal debug messages. This help investigating some boring syntax errors in the absence of an editor who will take charge of the work.
Other than that … anyone knows how to do a check (a variable or a method) if I am in debug mode and thus avoid to comment and uncomment the messages that I use for testing?

Thank you.

I use a global variable for that if I understand your message right. But I debug into a text file.

if ([glob_debug])==1) {
WriteDbg('something went wrong: ‘.$myvar.’ … etc
}

Thank you Albert
Simplest solutions are everytime the best!