The CreatorCon Call for Content is officially open! Get started here.

gs warn/error/info compared to gs log

Uncle Rob
Kilo Patron

Only slightly embarrassed that I don't know this.  I'm just updating my architecture best practices guide after stumbling on a system log that generates a few million records a day, mostly do to uncontrolled "logging".

I've always loved gs.log because the second parameter can be used as the Source column in system logs.

Does the same paradigm apply to gs.info, gs.warn, and gs.error?  It doesn't look that way according to docs.

 

5 REPLIES 5

jarodm
Mega Guru

These days, unless I'm extending an OOB scoped app, I typically use GSLog().

Source: https://docs.servicenow.com/bundle/madrid-application-development/page/script/useful-scripts/referen...

 

var logPrefix = 'eBondCore';
var logger = new GSLog('ebond_core.beta.log_level', logPrefix);
// 	var message = 'test logger';
// 	logger.debug(message+'debug');
// 	logger.info(message+'info');
// 	logger.warn(message+'warn');
// 	logger.error(message+'error');

 

Property governing the log level:

find_real_file.png

 

 

 

find_real_file.png

 

See you around on SNDevs!

 

JarodM