Edit this topic

Winston logger

: shell

: log

: winston-logger

: /modules/core/logging/services/winston-logger.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/logging/services/winston-logger.js

class: WinstonLogger

new WinstonLogger()

A logging service that uses Winston.

winstonLogger.verbose(msg, [meta])

Logs a message at the verbose level. The first parameter is localizable.

Param Type Description
msg string The message.
[meta] object An object to dump along with the message in order to give more information.

winstonLogger.debug(msg, [meta])

Logs a message at the debug level. The first parameter is localizable.

Param Type Description
msg string The message.
[meta] object An object to dump along with the message in order to give more information.

winstonLogger.info(msg, [meta])

Logs a message at the info level. The first parameter is localizable.

Param Type Description
msg string The message.
[meta] object An object to dump along with the message in order to give more information.

winstonLogger.warn(msg, [meta])

Logs a message at the warn level. The first parameter is localizable.

Param Type Description
msg string The message.
[meta] object An object to dump along with the message in order to give more information.

winstonLogger.error(msg, [meta])

Logs a message at the error level. The first parameter is localizable.

Param Type Description
msg string The message.
[meta] object An object to dump along with the message in order to give more information.

winstonLogger.log(level, msg, [meta], [callback])

Logs a message.

Param Type Description
level string The level of the message, chosen between verbose, debug, info, warn, and error.
msg string The message.
[meta] object An object to dump along with the message in order to give more information.
[callback] function An optional callback.

winstonLogger.profile(id, [metadata])

A simple profiling mechanism, functioning like a stopwatch. Call it once to start the timer, and call it a second time with the same id to stop the watch and log the time between the two calls.

Param Type Description
id string The watch id.
[metadata] object Metadata to log along with the time taken.