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) → {Promise.<Array.<any>>}
- Source:
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. |
Returns:
A tuple array returning an optional Error
in the first argument, or the new component in the second.
- Type
- Promise.<Array.<any>>
currentLevel() → {string}
- Source:
Gets the current threshold for logging events.
Returns:
The current threshold for logging events.
- Type
- string
debug(msg)
- Source:
Logs msg at DEBUG level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |
error(msg)
- Source:
Logs msg at ERROR level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |
fatal(msg)
- Source:
Logs msg at FATAL level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |
info(msg)
- Source:
Logs msg at INFO level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |
isActive(candidateLevel) → {boolean}
- Source:
Checks if a candidate level would log with current settings.
Parameters:
| Name | Type | Description |
|---|---|---|
candidateLevel |
string | A candidate level. |
Returns:
True if that level is logged.
- Type
- boolean
setLevel(newLogLevel) → {string}
- Source:
Sets the threshold for logging events.
Parameters:
| Name | Type | Description |
|---|---|---|
newLogLevel |
string | A new logging level. |
Returns:
The previous logging level.
- Type
- string
trace(msg)
- Source:
Logs msg at TRACE level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |
warn(msg)
- Source:
Logs msg at WARN level.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | A message to be logged. |