Name

global.AWALoggingUtils

Description

No description available

Script

var AWALoggingUtils = Class.create();
AWALoggingUtils.prototype = {
  
  initialize: function() {
  },

  atDebug: function(workItemGR) {
  	return this._getLogger(sn_log.GlideLogger.atDebug, workItemGR);
  },

  atInfo: function(workItemGR) {
  	return this._getLogger(sn_log.GlideLogger.atInfo, workItemGR);
  },

  atWarn: function(workItemGR) {
  	return this._getLogger(sn_log.GlideLogger.atWarn, workItemGR);
  },

  atError: function(workItemGR) {
  	return this._getLogger(sn_log.GlideLogger.atError, workItemGR);
  },
  
  _getLogger: function(loggerType, workItemGR) {
  	logger = loggerType().withLoggerName("com.snc.awa.script")
  		.withContext("app", "CI")
  		.withContext("track", "AWA")
  		.withContext("node", GlideClusterSynchronizer.getSystemID())
  		.withPrintableContext(["app", "track", "interaction", "work_item"]);

  	if (!!workItemGR && workItemGR.isValidRecord()) {
  		logger = logger.withContext("work_item", workItemGR.getUniqueValue());

  		if (workItemGR.getValue("document_table") == 'interaction')
  			logger = logger.withContext("interaction", workItemGR.document_id);
  	}
  	return logger;
  },
  
  type: 'AWALoggingUtils'
};

Sys ID

e98d2ee6732230104a905ee515f6a798

Offical Documentation

Official Docs: