winston
version?_winston@2
winston@3
node -v
outputs: v10.15.0const winston = require('winston');
const logger = winston.createLogger({
transports: [new winston.transports.Console()],
});
logger.info('logger ok.');
const childLogger = logger.child({ test: 'test value' });
childLogger.info('child logger ok');
{"message":"logger ok.","level":"info"}
{"message":"child logger ok.","level":"info"}
TypeError: logger.child is not a function
at Object.<anonymous> (/Users/onlybalance/test/logger.js:12:28)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
function child() is only available in Winston 3.2.0 which wasn't released yet
how can i create child loggers in the meantime easily?
how can i create child loggers in the meantime easily?
@joernroeder
Now available. It has been updated yesterday.