Script Logging Functions

The log functions enable adding debug, status, or bulk operation information to scripts, event logs, and bulk operation reports (via the log.toReport() function). See the Script Log, Event Log, and BulkOp Details sections above for instructions on accessing these logs.

log.info()

function log.info(message);
Description Add a message of type INFO to the Script and Event logs
Parameters message – Javascript string
Returns None
Required Libraries None
Example log.info("this is an info message");

 

log.warn()

function log.warn(message);
Description Add a message of type WARNING to the Script and Event logs
Parameters message – Javascript string
Returns None
Required Libraries None
Example log.warn("this is a warning message");

 

log.error()

function log.warn(message);
Description Add a message of type ERROR to the Script and Event logs
Parameters message – Javascript string
Returns None
Required Libraries None
Example log.error("this is an error message");

 

log.fatal()

function log.fatal(message);
Description Add a message of type FATAL to the Script and Event logs
Parameters message – Javascript string
Returns None
Required Libraries None
Example log.fatal("this is a fatal message");

 

log.toReport()

function log.toReport(Action,DataModelParameterName,Value);
Description Adds Action,DataModelParameterName,Value to the Script and Event logs and also to the BulkOperation Reports
Parameters

Action - Can be “Set” or “Get”

DataModelParameterName - JavaScript string which should starts with InternetGateWayDevice. or Device.

Value - Can be anything (Integer, Boolean, String, null, empty)

Returns None
Required Libraries None
Example log.toReport(“Set”,"InternetGatewayDevice.ManagementServer.PeriodicInformInterval",120);