LoggerModule

logger. LoggerModule

Module for logging message to the console

Constructor

new LoggerModule()

Source:

Extends

  • AbstractModule

Members

config :Object

Description:
  • Module configuration options
Source:
Module configuration options
Type:
  • Object

levelsConfig :Array

Description:
  • Defines what messages are logged
Source:
Defines what messages are logged
Type:
  • Array

logHook :Hook

Description:
  • Hook invoked on each message logged
Source:
Hook invoked on each message logged
Type:
  • Hook

Methods

getModuleOverrides(level) → {Array}

Description:
  • Returns a list of log levels with overrides, either inclusive or exclusive
Source:
Parameters:
Name Type Description
level String
Returns:
Type
Array

(async) init()

Source:

isLevelEnabled(level) → {Boolean}

Description:
  • Determines whether a specific log level is enabled
Source:
Parameters:
Name Type Description
level String
Returns:
Type
Boolean

isLoggingEnabled(level, id) → {boolean}

Description:
  • Returns whether a message should be logged (i.e. not disabled in the config)
Source:
Parameters:
Name Type Description
level string Logging level
id string Id of log caller
Returns:
Type
boolean

log(level, id, …args)

Description:
  • Logs a message to the console
Source:
Parameters:
Name Type Attributes Description
level String Severity of the message
id String Identifier for the message. Helps to differentiate between other messages.
args * <repeatable>
Arguments to be logged

(static) colourise(str, colour) → {String}

Description:
  • Colours an input string
Source:
Parameters:
Name Type Description
str String
colour String
Returns:
Type
String

(static) getDateStamp(config) → {String}

Description:
  • Returns a formatted date stamp
Source:
Parameters:
Name Type Description
config Object
Returns:
Type
String