Skip to main content

Crate xbbg_log

Crate xbbg_log 

Source
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§

AtomicLevelFilter
A tracing_subscriber::layer::Filter backed by an AtomicU8.
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.