error-stack: Report color formatting with tracing #8248
Unanswered
seijikun
asked this question in
Help (Libraries)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys, thank you very much for your awesome work on the error-stack crate!
I looked into it today and I love it, though I'm a bit confused about the whole
Reportprinting/formatting situation.I am using it together with
tracing. My use-case is this:Print the full
Reportlocally - and send a version of it over the network for storage.First thing I tried was:
which resulted in printed ANSI color escape characters - seems like
tracingescapes them.Weirdly enough, this causes the ANSI color escape characters to be interpreted/applied, but makes it a little harder to read:
I could globally configure the color mode to disable color sequences:
which works fine for the header and the backtrace, but attached
span tracesare still printed with escape characters.My original goal was to print with color locally and send over network without, but it seems the current API wasn't meant to do it that way(?). The only examples I could find always ever either used
eprintln!(), or returned the report fromfn main(). Is theReportstruct meant to be printed viatracing's macros?How do you guys print your errors in a nice way?
Beta Was this translation helpful? Give feedback.
All reactions