Module: caf_components/plug_log

A logger component.

Properties:

   {logLevel: string}

where logLevel sets the threshold for logging as one of OFF, FATAL, ERROR, WARN, INFO, DEBUG and TRACE (in that order)

Source:

Extends

Methods

(static) newInstance($, spec, cb)

Factory method to create a log plug component.

Parameters:
Name Type Description
$ ctxType

A context containing references to other components.

spec specType

Configuration data for this component.

cb cbType

A standard node.js callback returning an error or the new component.

Source:

currentLevel() → {string}

Gets the current threshold for logging events.

Source:
Returns:

The current threshold for logging events.

Type
string

debug(msg)

Logs msg at DEBUG level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source:

error(msg)

Logs msg at ERROR level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source:

fatal(msg)

Logs msg at FATAL level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source:

info(msg)

Logs msg at INFO level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source:

isActive(candidateLevel) → {boolean}

Checks if a candidate level would log with current settings.

Parameters:
Name Type Description
candidateLevel string

A candidate level.

Source:
Returns:

True if that level is logged.

Type
boolean

setLevel(newLogLevel) → {string}

Sets the threshold for logging events.

Parameters:
Name Type Description
newLogLevel string

A new logging level.

Source:
Returns:

The previous logging level.

Type
string

trace(msg)

Logs msg at TRACE level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source:

warn(msg)

Logs msg at WARN level.

Parameters:
Name Type Description
msg string

A message to be logged.

Source: