diff --git a/mixtcp/examples/cloudflare_ping.rs b/mixtcp/examples/cloudflare_ping.rs index 9200969a1a..2c1d79f2b8 100644 --- a/mixtcp/examples/cloudflare_ping.rs +++ b/mixtcp/examples/cloudflare_ping.rs @@ -129,11 +129,13 @@ fn inspect_tls_packet(data: &[u8]) { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); } diff --git a/mixtcp/examples/https_client.rs b/mixtcp/examples/https_client.rs index 27d3a180aa..c49f83f180 100644 --- a/mixtcp/examples/https_client.rs +++ b/mixtcp/examples/https_client.rs @@ -274,11 +274,13 @@ impl MixtcpResponse { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); } diff --git a/mixtcp/examples/tls.rs b/mixtcp/examples/tls.rs index 17502a8ed7..749e9ecc14 100644 --- a/mixtcp/examples/tls.rs +++ b/mixtcp/examples/tls.rs @@ -130,11 +130,13 @@ fn inspect_tls_packet(data: &[u8]) { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); }