Question

I don't know if it's just me, but

var winston = require('winston');
winston.log('This wont print');
winston.info('But this will.');

only prints the second line.

Why doesn't it print the log? I just want to print log, with a level: log

winston.log('log', 'This wont print');

Is this not possible or am I doing something wrong?

Was it helpful?

Solution

Well, turns out it is impossible because log is not a log level, but info is.

Thanks to @elmigranto in #node.js for pointing it out.

OTHER TIPS

var winston = require('winston');
:
:
:
winston.level = 'your log level';

This will set the log level to 'your log level'. (Tested with winston 0.7.3)

better way use :

console.log('your log')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top