-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
Description
When pretty-print is redirected to a file, ANSI color codes are written in the text like so:
[2019-06-03T21:29:02.454Z] INFO (30) (@slonik): client is checked out from the pool
�[32mpoolId: �[39m 01DCFKXQJTBGX5FT2X8HEKP5JS
�[32mprocessId: �[39m�[34m9192�[39m
�[32mstats: �[39m
�[32midleConnectionCount: �[39m �[34m0�[39m
�[32mtotalConnectionCount: �[39m�[34m1�[39m
�[32mwaitingRequestCount: �[39m �[34m0�[39m
This is pretty unreadable.
The program should try to detect if the written device supports color. It can be done with system calls like isatty on Posix and GetConsoleScreenBufferInfo on Windows. (don't know how to do it on Node though)
There also should also be a flag to force colors on or off regardless of the detection.