1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/// Initialize tracing for tests with sensible defaults.
///
/// This function configures tracing to work correctly with cargo test's output capture,
/// ensuring that log output is only shown for failed tests. It uses [`std::sync::OnceLock`]
/// to ensure that logging is initialized only once per test process, regardless of how many
/// times this function is called.
///
/// # Log Level
///
/// Defaults to DEBUG level, but can be overridden by setting `CGX_LOG` or `RUST_LOG`
/// environment variables before running tests (`CGX_LOG` takes priority).
///
/// # Usage
///
/// Call this at the beginning of any test that would benefit from seeing log output.
pub