Closed fiznool closed 6 years ago
That's because winston disables the colors when it is not connected to a tty. This isn't an issue with node-foreman.
Why does this only occur when the output is trimmed? If Winston disables colours in non tty environments, I would have thought colours would be hidden in both scenarios above.
oh sorry! ignore my previous comment. I think this is why: https://github.com/strongloop/node-foreman/blob/master/lib/console.js#L27
Probably what needs to happen is to determine how long the string is sans-ascii-escapes and trim based on that.
Yes that looks like the issue! If I get any time I'll try to put together a PR which solves this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm using winston to log messages to the console. When using the
--trim
option, if the line is trimmed, colors are lost.See screenshot:
Notice that the
info
text is colorised correctly in the first case, but not when--trim
has trimmed the lines.