Hi,
I was looking to use the Console Transport out of box, but also wanted to have pretty colors. As it stands it appears the only way to achieve this is by removing the default Console Transport and adding it back with an options object, a-la:
var log = require('winston');
log.remove(log.transports.Console);
log.add(log.transports.Console, {colorize: true});
I'm looking to set that option without removing, then adding it back.. perhaps something that piggybacks off of the existing winston.addColors(myCustomLevels.colors);
but without an argument, which could also let you potentially override the default color scheme, since it looks like you can't do that right now either (I tried):
var log = require('winston');
log.addColors();
:+1:
I do this enough to wrap it up into a module log-colors
var log = require('log-colors')
log.debug('yay colors', {
foo: 'bar'
})
I have hacked it that way
app.start 3000, ->
app.log.loggers.default.transports.console.colorize = true
I suspect it's not very elegant, but it works. There are some other interesting properities like prettyPrint
and timestamp
. It's important to do it inside app.start
callback, as app.log
is undefined before that.
You can just call the cli() method as well.
Most helpful comment
You can just call the cli() method as well.