LoggerModule

logger. LoggerModule

Module for logging message to the console

Constructor

new LoggerModule()

Source:

Extends

  • AbstractModule

Members

config :Object

Source:
Module configuration options
Type:
  • Object

levelsConfig :Array

Source:
Defines what messages are logged
Type:
  • Array

logHook :Hook

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

Methods

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

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

(static) getDateStamp(config) → {String}

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

getModuleOverrides(level) → {Array}

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

(async) init()

Source:

isLevelEnabled(level) → {Boolean}

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

isLoggingEnabled(level, id) → {boolean}

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

log(level, id, …args)

Source:
Logs a message to the console
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