Can I get some recommendations for error formatting crates? I find myself wanting something more feature rich than `format!`
-
Show this thread
-
Here's what I want. * specify an error message and pass in variables like format! * be able to suggest fixes or add notes and additional info like rustc errors * integrate with `tracing` so it can pull in the span context info.
2 replies 0 retweets 4 likesShow this thread -
* tracing style structured logging like so I can write something like `f!(host, "Unable to connect to remote host");` which would render as `Unable to connect to host. host=Host("hostname")` * plays nicely with anyhow::Error and Context and how it renders errors and error chains.
1 reply 0 retweets 4 likesShow this thread -
I'm pretty confident nothing out there hits all of these requirements, but I bet theres some crates that come close and I can either build what I want ontop of them or do some PRs to get what I want, now I just need to find them.
2 replies 0 retweets 2 likesShow this thread -
For example, I dont think anything integrates with tracing, or even likely provides tracing-like structured logging. I'm hoping to get a nice format! alternative that is tracing aware that I could use to pass strings into the error formatting crate.
3 replies 0 retweets 2 likesShow this thread -
Here's my shittiest quick and dirty version of attempting to replicate what I want. Not necessarily this output format or this API but this general set of features and use case. The format! at the end is a hand rolled version of tracing ISH context I want to shove in.pic.twitter.com/nP8b3W1TFT
2 replies 0 retweets 6 likesShow this thread
yosh Retweeted yosh
Haa, was just thinking about doing something similar: https://twitter.com/yoshuawuyts/status/1204049586689474561?s=19 … Now wondering if there could be a nice way to go string -> io::Error for example. Perhaps using `?`.
yosh added,
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.