Closed kingcody closed 9 years ago
Hrm... No color for TTY output is desirable in most cases, though; if you're piping your logs to a file, you probably don't want color in there. It would be nice if we could leave colors off for non-tty output by default, but turn it on if someone passed in an appropriate option (say, forceColor
) to BunyanDebugStream. The problem here is that we're setting a global variable in colors
to do this, so if you create two BunyanDebugStreams, one with forceColor
and one without, they'd both show colors (although I suppose you'd probably never do this...)
Fixed in v1.0.7 with forceColor
option.
@jwalton thanks! Sorry for the shortsightedness with the option being globally persistent.
No worries. Thanks for figuring this out. :)
see Marak/colors.js#102