Avoid creating more than one log subscriber (when integration tests are running)

This commit is contained in:
Greg Burri 2025-05-16 00:26:44 +02:00
parent 0f88e6dd90
commit 0c43935bef

View file

@ -94,9 +94,16 @@ impl Log {
.with_thread_ids(TRACING_DISPLAY_THREAD)
.with_thread_names(TRACING_DISPLAY_THREAD);
tracing_subscriber::Registry::default()
if let Err(error) = tracing_subscriber::Registry::default()
.with(layer_stdout)
.init();
.try_init()
{
// It happens during the integration tests.
eprintln!(
"Error during initialization of the tracing subscriber: {}",
error
);
}
Log::StdoutOnly
}