loglevel-plugin-format
fork from loglevel-plugin-prefix
loglevel plugin for log message formatting
Installation
npm install loglevel-format --save
API
;
This method applies the plugin to the logger.
log - root logger, imported from loglevel package
options - configuration object
var defaults = template: '{"timestamp": %t, "level": %l, "message": %m}' { return data; } { return date; } { return level; } { return name || 'root'; };
The template is a string containing zero or more placeholder tokens. Each placeholder token is replaced with the value from loglevel messages parameters. Supported placeholders are:
- %t - timestamp of message
- %l - level of message
- %n - name of logger
- %m - message of logger