architect-winston-logger
v2.0.1
Published
Wrapper for winston to use architect
Downloads
13
Readme
architect-winston-logger
Wrapper for using winston as an architect plugin
Prerequisites
- Include this package as an architect plugin in your application.
- Inject
loggerFactory
by declaring it in theconsumes
array of one of your plugins
Usage
module.exports = function (options, imports) {
var loggerA = imports.loggerFactory.create('loggerA', 'task1');
loggerA.log('info', 'Something wrong');
// info: [task1] Something wrong
var loggerB = loggerA.createChild('subtask2');
loggerB.log('info', 'Something else');
// info: [task1:subtask2] Something else
loggerB.destroy();
};