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
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license OR Apache 2.0
//! Runtime toggle for QUIC connection diagnostic logging.
//!
//! By default, QUIC connection lifecycle logging is **disabled**. Library consumers
//! can enable it at runtime to get detailed `tracing` events for connection
//! establishment, drops, timeouts, resets, and other QUIC-specific conditions.
//!
//! # Usage
//!
//! ```rust
//! // Enable QUIC connection logging at application startup
//! snocat::quic_logging::enable();
//!
//! // Disable it again if needed
//! snocat::quic_logging::disable();
//!
//! // Check current state
//! if snocat::quic_logging::is_enabled() {
//! println!("QUIC connection logging is active");
//! }
//! ```
//!
//! The emitted events use the `tracing` crate at appropriate severity levels
//! (`error`, `warn`, `info`, `debug`) and are only generated when logging is
//! enabled, so there is negligible overhead when disabled.
use ;
static ENABLED: AtomicBool = new;
/// Enable QUIC connection diagnostic logging.
///
/// Once enabled, the library emits `tracing` events for QUIC connection
/// lifecycle events such as connection creation, handshake failures,
/// idle timeouts, transport errors, stateless resets, and graceful closures.
/// Disable QUIC connection diagnostic logging.
/// Returns `true` if QUIC connection diagnostic logging is currently enabled.