Hello, I've been using color_eyre on a work project, and had experienced troubles with the logging (using tracing/tracing_subscriber).
What happening and what should happen ?
Observed Behavior: Creating a eyre::Report before initializing the tracing_subscriber even if we're ignoring it makes subsequent logs disappear.
Expected Behavior: The logs should still be printed, wether or not a eyre::Report is created.
Why is this issue on color_eyre and not on tracing_subscriber ?
While testing and trying to know what was happening, I switched to stable_eyre, and the issue fixed itself, so this must come from color_eyre.
Here is a minimal reproduction of the bug:
fn main() {
// Initialize the `color_eyre` Handler
color_eyre::install().unwrap();
// If any [`eyre::Report`] is created (not even returned) at any point before
// the initialization of the `tracing_subscriber`, the tracing logs never output
let _ = color_eyre::eyre::eyre!("A very ignorable error, so we ignore it");
// ^ If we were to comment this line, the log would appear
// Initialize the `tracing_subscriber` Subscriber
tracing_subscriber::fmt::init();
tracing::info!("This log never appears in the console");
}
and I'm using the following versions of crates in my Cargo.toml:
[dependencies]
tracing = "0.1.35"
tracing-subscriber = "0.3.11"
color-eyre = "0.6.1"
Don't hesitate to ask any question :)
Thanks !