Constructor
new Logger(confObject, loggingInitializedPromise)
Parameters:
Name | Type | Description |
---|---|---|
confObject |
object | The configuration for the logger |
loggingInitializedPromise |
promise | a promise indicating that the logger has finished being asynchronously initialized |
Methods
(async) _init(The)
Adds writer functions to the logger
Parameters:
Name | Type | Description |
---|---|---|
The |
object | configuration for the logger |
(async) debug(msg)
The logger's debug method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |
(async) error(msg)
The logger's error method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |
(async) fatal(msg)
The logger's fatal method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |
handleLog(log, level) → {object}
Turns a string log message into an object, and adds additional information. If the log is already an object, some additional information is added
Parameters:
Name | Type | Description |
---|---|---|
log |
string | object | the log that will be prepared for saving or printing |
level |
string | The log level function from which this function has been called |
Returns:
a standardized logging object containinf at least the time of logging, a message and the level
- Type
- object
(async) info(msg)
The logger's info method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |
(async) log(obj)
The logger's general logging method. Calls one of the logging methods
Parameters:
Name | Type | Description |
---|---|---|
obj |
object | An object containing at least a level and a message. |
(async) trace(msg)
The logger's trace method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |
(async) warn(msg)
The logger's warn method
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | object | the message to be logged |