Skip to main content

init_tracing_for_test

Function init_tracing_for_test 

Source
pub fn init_tracing_for_test()
Expand description

Initialise the global tracing subscriber, silently ignoring duplicate inits.

Why: Test binaries may link multiple test modules that all call setup code. try_init returns an error on the second call instead of panicking, so test runs remain stable regardless of execution order. What: Calls try_init(); swallows the error if already initialised. Test: init_tracing_for_test_is_idempotent.