You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using tracing in a larger application using tracing-error is quite helpful. It woul be great to have an option to allow capturing a tracing_error::SpanTrace similar to how backtrace capturing works, as part of the generated macro.
I'd be happy to write up a PR, but wanted to get some feedback on this first
#[derive(Debug,Snafu)]pubenumCoolError{A{bactrace:Option<Backtrace>,// Auto detectedspan_trace:SpanTrace,}B{#[snafu(span_trace)]// manual annotationmy_cool_span_trace:SpanTrace,}}// Access through sth like extending the ErrorsCompat traitpubtraitErrorsCompat{// make the dependency fully dependent on the feature flag#[cfg(feature = "tracing-error")]fnspan_trace(&self) -> Option<&SpanTrace>{None}}
The text was updated successfully, but these errors were encountered:
Thanks for the quick response, while that works nicely to generate, it does not give me a way to access the trace in a generic fashion as far as I can tell unfortunately. I am working on a reporting like structure, (that works on stable rust..) and managed to get the backtraces extracted from different error types, thanks to the ErrorCompat::backtrace functionality.
When using
tracing
in a larger application usingtracing-error
is quite helpful. It woul be great to have an option to allow capturing atracing_error::SpanTrace
similar to how backtrace capturing works, as part of the generated macro.I'd be happy to write up a PR, but wanted to get some feedback on this first
The text was updated successfully, but these errors were encountered: