Creates a new AioLogger instance.
Kind: Exported function
Param | Type | Description |
---|---|---|
moduleName | string |
module name to be included with the log message. |
[config=] | {AioLoggerConfig} configuration for the log framework. |
This class provides a logging framework with pluggable logging provider. Winston is used by default.
Kind: inner class of module.exports
Constructor
Param | Type | Default | Description |
---|---|---|---|
moduleName | string |
module name to be included with the log message. | |
[config] | AioLoggerConfig |
{} |
for the log framework. |
Close the logger. Useful when writing logs to a file or stream.
Kind: instance method of AioLogger
log error message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log warn message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log info message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log message (equivalent to info)
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log verbose message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log debug message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
log silly message.
Kind: instance method of AioLogger
Param | Type | Description |
---|---|---|
[...data] | object | string |
data to be logged. Prints to the logger with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()). |
configuration for the log framework
Kind: inner typedef of module.exports
Properties
Name | Type | Description |
---|---|---|
[level] | string |
logging level for winston, defaults to info |
[transports] | string |
transport config for winston, defaults to undefined |
[silent] | boolean |
silent config for winston, defaults to false |
[provider] | string |
defaults to winston, can be set to either 'winston' or 'debug' |
[logSourceAction] | boolean |
defaults to true if __OW_ACTION_NAME is set otherwise defaults to false. If running in an action set logSourceAction to false if you do not want to log the action name. |