Skip to content

Latest commit

 

History

History
159 lines (110 loc) · 8.84 KB

api.md

File metadata and controls

159 lines (110 loc) · 8.84 KB

@adobe/aio-lib-core-logging

module.exports(moduleName, [config=]) ⏏

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.

module.exports~AioLogger

This class provides a logging framework with pluggable logging provider. Winston is used by default.

Kind: inner class of module.exports

new AioLogger(moduleName, [config])

Constructor

Param Type Default Description
moduleName string module name to be included with the log message.
[config] AioLoggerConfig {} for the log framework.

aioLogger.close()

Close the logger. Useful when writing logs to a file or stream.

Kind: instance method of AioLogger

aioLogger.error([...data])

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()).

aioLogger.warn([...data])

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()).

aioLogger.info([...data])

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()).

aioLogger.log([...data])

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()).

aioLogger.verbose([...data])

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()).

aioLogger.debug([...data])

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()).

aioLogger.silly([...data])

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()).

module.exports~AioLoggerConfig : object

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.