-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for std::backtrace::Backtrace #24
Comments
I don't know if the |
Thanks for the issue -- I didn't realize this got merged & this is great news! I'd definitely love to support this. It appears to me like we will have to opt for the same ugly hack as with failure backtraces, that is pasting the underlying data structs from The RFC explicitly describes this minimal interface without access to the backtrace frames, so changing this would likely require another RFC. |
I had a look into this today and, unfortunately, this is not as easy to support as with failure. The |
Alright I did the thing, I wrote a deserializer for https://crates.io/crates/btparse Once I've finished with the fmt stuff I'll open a PR resolving this issue assuming someone else doesn't get to it first. The plan is to add the support as an experimental feature which enables the dependency on btparse and conditionally compiles the code using it. It should be stable API wise, and returns a |
@yaahc You are parsing the debug format of std::backtrace::Backtrace, and the Debug formats in stdlib are specifically not guaranteed to be stable. So I don't think your solution is workable. |
@winstonewert my proposal is that the support via debug is put behind a feature flag saying unstable-stdbt or something that makes it clear that Also, the btparse deserialize function returns an error if it fails to parse it, so this shouldn't even cause runtime issues, color-backtrace can just fall back to the std provided uncolored I don't know about you, but I don't particularly care if my programs on nightly "break" and stop showing colored backtrace and instead show the default uncolored one, its still better than the current state which is permanently uncolored and unfiltered. |
std::error::Error
has an experimental support for providing a backtrace of typestd::backtrace::Backtrace
. However color-backtrace accepts only typesbacktrace::Backtrace
andfailure::Backtrace
in its printing functions.Would it be possible to add support for the
std
variant as well? I'm not sure how hard it would be, because it doesn't expose its inner frames.The text was updated successfully, but these errors were encountered: