-
Notifications
You must be signed in to change notification settings - Fork 83
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
GEN-159: Local install_debug_hook
#4524
Comments
install_debug_hook
Hi @tisonkun. Yes, the mentioned functions are global. Do you have an idea how we could achieve the behavior? If I understand correctly you want to attach more information to the Maybe, it's possible to add a function which internally adds formatting hooks to one report and use the global functions as fallback, what do you think @indietyp? |
That should be possible. Yes. There might be some hurdles in implementing this in a way that isn't overcomplicating things, but in theory: Yes. |
I'm not quite familiar with the codebase and don't take a closer look yet. But here are two major considerations:
Combine 1 and 2 may be a way to the solution. Hopefully this helps :D |
After a closer look, I can see that here come two different issues: The color mode and charset can be passed manually, by creating a The hook and context can be much more complex. But basically, print That said, we generally respect user-installed hooks, but the current always install backtrace built-in hook too noisy in some case. |
@indietyp and I discussed how this could be implemented and we currently figuring out what the best API would be. Most likely it will be possible to simply
Having a dedicated feature flag for |
Related Problem
Report::install_debug_hook
/Report::set_color_mode
/Report::set_charset
seems all global settings.I'd prefer to switch the manner locally. For example, I'd switch the manner when returning HTTP error response to trim the Backtrace with
Report::install_debug_hook::<std::backtrace::Backtrace>(|_, _| {});
as well as use ASCII and no color, but I'm OK with these settings in all other situations.Proposed Solution
No idea. I'm not quite sure about the philosophy.
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: