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
This is somewhat related to the existing backtrace support. For user-facing application logs, it's useful to log two locations:
Where the error itself was logged,
Where the error object itself was created.
Right now, the second point is caught in the backtrace, but it'd be useful if we could pull out just the location where the error object itself was constructed (as opposed to the whole stack).
There was some discussion in #22 around handling this is user code via e.g. an extension trait, but it would be helpful if this could be part of the default behavior -- that is, any error object converted to anyhow::Result<> via ? could automatically be tagged with an error location (if backtraces are enabled), and users could decide whether to include that error location when logging those errors.
(In theory, users of anyhow could post-process the backtrace message and figure out which line is relevant, but I'm hoping there's some tooling in the backtrace crate that would make it easier to do when the trace itself is constructed.)
The text was updated successfully, but these errors were encountered:
This is somewhat related to the existing backtrace support. For user-facing application logs, it's useful to log two locations:
Right now, the second point is caught in the backtrace, but it'd be useful if we could pull out just the location where the error object itself was constructed (as opposed to the whole stack).
There was some discussion in #22 around handling this is user code via e.g. an extension trait, but it would be helpful if this could be part of the default behavior -- that is, any error object converted to
anyhow::Result<>
via?
could automatically be tagged with an error location (if backtraces are enabled), and users could decide whether to include that error location when logging those errors.(In theory, users of anyhow could post-process the backtrace message and figure out which line is relevant, but I'm hoping there's some tooling in the
backtrace
crate that would make it easier to do when the trace itself is constructed.)The text was updated successfully, but these errors were encountered: