Logger

log. Logger

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

Members

listener

Description:
  • The listener function attached to this logger.

Source:

The listener function attached to this logger.

name

Description:
  • The name of this logger

Source:

The name of this logger

Methods

atLevel(level, msg, …objects)

Description:
  • 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.

Source:
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

debug()

Description:
  • Logs at DEBUG level.

Source:
See:
  • atLevel

error()

Description:
  • Logs at ERROR level.

Source:
See:
  • atLevel

info()

Description:
  • Logs at INFO level.

Source:
See:
  • atLevel

trace()

Description:
  • Logs at TRACE level.

Source:
See:
  • atLevel

warn()

Description:
  • Logs at ERROR level.

Source:
See:
  • atLevel