Closed jameswyse closed 10 years ago
You mean adding additional coloring to a message? like intel.debug('foo %s baz', chalk.red('bar'));
?
Yep! Great for console but you end up with lines like this in log files:
[36m[1mDEBUG[22m[39m: [[1mapp[22m] foo [31mbar[39m baz
:scream:
Sure, makes sense.
I'm sorry I didn't think of this sooner: why not just run chalk.stripColor() on the formatted string before returning? Faster, easier.
haha yeah totally, I've done exactly that in 9c4a572. Much easier.
Sorry about that, I blame my broken coffee machine :/
Let me know if I've missed anything!
Awesome! I should have noticed the first time, but I was in-between Titanfall matches.
Can you squash the commits into 1? Then I'll merge it in :D
I tend to add colours to my log messages to make them easier to read during development (plus I'm a sucker for pretty console output), but it's not ideal to keep the colours around when logging to a file or database.
I've added a new
strip
option to the formatter that runs themessage
andargs
through chalk.stripColor. It also disablescolorize
if both are enabled at once - cause that's just silly.Thoughts?