Logger

log. Logger

Logger class. A named logger providing the ability to log formatted messages.

Members

listener

Source:

The listener function attached to this logger.

name

Source:

The name of this logger

Methods

error()

Source:
See:
  • atLevel

Logs at ERROR level.

warn()

Source:
See:
  • atLevel

Logs at ERROR level.

info()

Source:
See:
  • atLevel

Logs at INFO level.

debug()

Source:
See:
  • atLevel

Logs at DEBUG level.

trace()

Source:
See:
  • atLevel

Logs at TRACE level.

atLevel(level, msg, …objects)

Source:

Logs a message at the supplied level. The message may include placeholders {} which will be substituted into the message string only if the message is actually logged.

Example
log.atLevel('INFO', 'The widget was created as {}', widget);
Parameters:
Name Type Attributes Default Description
level string

The level at which to log, such as 'INFO', or 'DEBUG'

msg string | Error

the message to log, possibly with object placeholders

objects Array.<object> <repeatable>
[

the objects to substitute into the log message