Expand description
Logging infrastructure for the xbbg workspace.
Provides a zero-GIL tracing setup for Rust-Python hybrid libraries.
Python controls the log level via an AtomicU8 — no GIL acquisition
ever happens on the logging hot path.
§Architecture
tracing::debug!("...")
→ AtomicLevelFilter (reads AtomicU8 ~1ns, zero GIL)
→ fmt::layer
→ stderr§Usage from Python
import xbbg
xbbg.set_log_level("debug") # sets AtomicU8, returns immediately
xbbg.set_log_level("warn") # back to quiet (default)§Usage from Rust
Other crates in the workspace depend on xbbg-log and use the
re-exported tracing macros:
ⓘ
use xbbg_log::{trace, debug, info, warn, error};
info!(worker_id = 0, "request completed");§Developer Override
Setting RUST_LOG to a simple level (trace, debug, info, warn, or
error) sets the initial global level. Python can still change it later via
xbbg.set_log_level().
Macros§
- debug
- Constructs an event at the debug level.
- debug_
span - Constructs a span at the debug level.
- error
- Constructs an event at the error level.
- error_
span - Constructs a span at the error level.
- info
- Constructs an event at the info level.
- info_
span - Constructs a span at the info level.
- trace
- Constructs an event at the trace level.
- trace_
span - Constructs a span at the trace level.
- warn
- Constructs an event at the warn level.
- warn_
span - Constructs a span at the warn level.
Structs§
- Atomic
Level Filter - A
tracing_subscriber::layer::Filterbacked by anAtomicU8. - Level
- Describes the level of verbosity of a span or event.
Functions§
- current_
level - Get the current global log level.
- init
- Initialize the global tracing subscriber.
- parse_
level - Parse a level string (case-insensitive) into a
Level. - set_
level - Set the global log level.