Open Emilgardis opened 8 months ago
Would the project be open to a PR that implements nr. 2? Introducing setters and getters for the fields on https://github.com/eyre-rs/color-eyre/blob/4a5297d30b0f0754a3bbc47b71bb55b04960c0ad/src/lib.rs#L397-L417, or possibly even making them pub
but making Handler
#[non_exhaustive]
I wanted to switch the style of a specific report, this to circumvent https://github.com/eyre-rs/color-eyre/issues/122 not working and it not being formatted optimally with the env section being repeated.
I have the following code
but I get a panic:
The issue is that
HookBuilder::into_hooks
callscolor_spantrace::set_theme
https://github.com/eyre-rs/color-eyre/blame/6a9b70b44d11e0540b9dbc325149bab2a5d505b6/src/config.rs#L756
This issue persists on the current
master
branch as well.Now, I'm not sure if this is truly the way to go so I have two propositions that would make me happy.
EyreHook
withoutset_theme
(this would also need a way to get the location I discovered, to propagate into the new handler)report.handler_mut().downcast_mut::<color_eyre::Handler>().unwrap().display_env_section = false
I think that nr. 2 is the best option, since it makes it easy to customize a report "in-flight"