Creating a child of a given logger actually modifies the parent logger, making sibling-loggers useless:
var logger = new Winston.Logger({transports: [new winston.transports.Console()]});
logger.info('test'); // outputs `info: test`
var child1 = new WinstonChild(logger, {child: 1});
logger.info('test'); // outputs `info: test child=1`
child1.info('test'); // outputs `info: test child=1`
I wouldn't expect logger.info(…) to have the child=1 metadata associated.
And it get's worse with a sibling logger:
var child2 = new WinstonChild(logger, {child: 2});
logger.info('test'); // outputs `info: test child=2`
child1.info('test'); // outputs `info: test child=2`
child2.info('test'); // outputs `info: test child=2`
Creating a child of a given logger actually modifies the parent logger, making sibling-loggers useless:
I wouldn't expect
logger.info(…)
to have thechild=1
metadata associated.And it get's worse with a sibling logger: