When I write logs to a file with tracing-appender, I get output with terminal color artifacts which do not render when viewing them as a text file:
[2mOct 02 23:44:57.484[0m [34mDEBUG[0m
Is there a way to drop these artifacts?
When I write logs to a file with tracing-appender, I get output with terminal color artifacts which do not render when viewing them as a text file:
[2mOct 02 23:44:57.484[0m [34mDEBUG[0m
Is there a way to drop these artifacts?
The
with_ansi()
option is on by default when usingtracing_subcriber::fmt()
. Set it tofalse
by using the builder method to declare your subscriber:You can have multiple subscribers if you want to inject color on the terminal but not in the file.