Setting log level for log.child object

89 views
Skip to first unread message

PD

unread,
Sep 7, 2015, 1:51:55 PM9/7/15
to bunyan-logging
Hello team,

Looking for ways to set the logging level of log.child object independent of log object, any idea how to do that?  Thanks!

For e.g.
var bunyan = require('bunyan');
var log = new bunyan({name: 'myapp'});

function Wuzzle(options) {
    this.log == options.log.child({widget_type: 'wuzzle'});
    this.log.info('creating a wuzzle')
}
Wuzzle.prototype.woos = function () {
    this.log.warn('This wuzzle is woosey.')
}
//log.child.level(60);
log.info('start');
var wuzzle = new Wuzzle({log: log});
log.info({widget_type: 'wuzzle'}, 'hi');
log.child.level(60);  >>>>>>>>>>>>>>>>>>>>>>>>>>>How to set the level of log.child object to 60????
log.level({widget_type: 'wuzzle'});
wuzzle.woos();
log.info('done');
Reply all
Reply to author
Forward
0 new messages