hof-logger
v2.0.0
Published
Common logger pattern
Downloads
82
Maintainers
Keywords
Readme
hof-logger
Common logger pattern
Installation
$ npm install hof-logger --save
Usage
hof-logger exports a function which you can call to access a winston logger instance.
var logger = require('hof-logger')();
logger.info('A message');
Options
Options can be passed and take the form of the following example
var createLogger = require('hof-logger');
var logger = createLogger({
levels: {
info: 0,
email: 1,
warn: 2,
error: 3
},
colours: {
info: 'green',
email: 'magenta',
warn: 'yellow',
error: 'red'
},
transportOptions: {
json: true,
timestamp: true,
colorize: true,
stringify: JSON.stringify
}
});