Class LogInstance

LogInstance

Description:

Logger with its own context (also called status or state). New instances are created with WL.Logger.create.

Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.debug('Hello world');
//[myapp] Hello world

Method Summary
Method Attributes Method Name and Description
 
debug(message)
Prints arguments to the console.
 
error(message)
Prints arguments to the console.
 
fatal(message)
Prints arguments to the console.
 
info(message)
Prints arguments to the console.
 
trace(message)
Prints arguments to the console.
 
warn(message)
Prints arguments to the console.
Method Detail
debug
debug(message)
Prints arguments to the console. Has a priority of 500 and a level of DEBUG.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.debug('Hello world');
//[myapp] Hello world

error
error(message)
Prints arguments to the console. Has a priority of 100 and a level of ERROR.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.error('Hello world');
//[myapp] Hello world

fatal
fatal(message)
Prints arguments to the console. Has a priority of 50 and a level of FATAL.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.fatal('Hello world');
//[myapp] Hello world

info
info(message)
Prints arguments to the console. Has a priority of 300 and a level of INFO.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.info('Hello world');
//[myapp] Hello world

trace
trace(message)
Prints arguments to the console. Has a priority of 600 and a level of TRACE.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.trace('Hello world');
//[myapp] Hello world

warn
warn(message)
Prints arguments to the console. Has a priority of 200 and a level of WARN.
Parameters:
message - One or more messages of any data type.
Example:
var logger = WL.Logger.create({pkg: 'myapp'});
logger.warn('Hello world');
//[myapp] Hello world

© Copyright IBM Corp. 2011, 2016.