logo

NJP

Large Teams (Part 1 of 3) - Debugging

Import · Feb 24, 2012 · article

this._debug('loadNextTask(): querying table…');

When you want to turn all the debug statements off in that script include, just go to initialize() and set this.debug=false.
* For Business Rules, use a local variable with your debug prefix, such as:

allMyCircuits();function allMyCircuits() { var dPref = '>>>DEBUG: BR: All My Circuits ' + current.number + ' '; gs.log(dPref + 'starting the function');}

It's fairly trivial to use a gs.log() call and get useful information to filter on. One final note, I included the name of the business rule in the log. I often forget to turn off those debug messages after development is done. Months later I find them cluttering up the log. It's nice to know where they are coming from!Reference:

gs.log()

View original source

https://www.servicenow.com/community/in-other-news/large-teams-part-1-of-3-debugging/ba-p/2265832