A simple implementation of the Winston Logger
npm i [-S|D] winston
const chillWinston = require('chill-winston');
// chillWinston(loggerLevel = 'info', file = null, opts = {})
const logger = chillWinston('debug', '/path/to/logfile.log', {})
logger.notice('My message', {
my: 'addional',
data: 'stuff',
});
loggerLevel
: Loglevel for Winston to use. See https://www.npmjs.com/package/winston#logging-levels. Default: 'info'
logfile
: A file for Winston to log to. If null, will only log to console. Default: null
opts
: Options object. Takes the following parameters. Default: {}
-
loggerFormat
: Logger format to use. See https://www.npmjs.com/package/winston#formats. If not set, uses a colorized format with timestamp, message and data. -
loggerTransports
: Additional tranpsorts to use. Will be appended to the base transports oftransports.Console
andtransports.File
-
winston
: Additional options has to be passed through to thewinston
instance. See https://www.npmjs.com/package/winston#logging