Logger

Logger

Represents Logger for SDK.

Constructor

new Logger()

Methods

(static) getInstance() → {Logger}

Get a singleton Logger instance.
Returns:
Type:
Logger
returns singleton instance of Logger.
Example
// should set log level first
ThingIF.Logger.getInstance().setLogLevel(ThingIF.LogLevel.Debug);

getLogLevel()

Get level of logger.
Returns:
level of logger.

log(level, msg)

Make a log record. log methods provides the same string interpolation methods of winston.Logger.log().
Parameters:
Name Type Description
level string level should be one of values of const LogLevel.
msg string log message.

logHttpRequest(level, req)

Internal usage only. SDK uses it to log http request.
Parameters:
Name Type Description
level string log level for this request. Should be one of values of const LogLevel.
req any request object.

setLogLevel(level)

Set level of logger.
Parameters:
Name Type Description
level string level should be one of values of const LogLevel.