Avoid creating more than one log subscriber (when integration tests are running)
This commit is contained in:
parent
0f88e6dd90
commit
0c43935bef
1 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue