Skip to main content

Module logging

Module logging 

Source
Expand description

Logging and diagnostics.

The framework emits all of its diagnostics through the tracing facade and installs no subscriber of its own — the level, format, and destination are entirely yours to choose. Until you install a subscriber, the events are silently dropped.

A minimal setup using tracing-subscriber prints to stderr and reads its filter from the RUST_LOG environment variable:

tracing_subscriber::fmt()
    .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
    .init();

Connection lifecycle and handler failures are logged at info/warn/error.

§Raw protocol logging

Every line read from and written to the server is emitted at the TRACE level on the dedicated PROTOCOL_LOG_TARGET target, tagged with a dir field of "recv" or "send". This is opt-in: it stays silent unless you enable that target at TRACE, for example:

RUST_LOG=ircbot=info,ircbot::protocol=trace cargo run

Protocol traces contain the full, unredacted message content, so enable them only while debugging.

Constants§

PROTOCOL_LOG_TARGET
Tracing target for raw IRC protocol lines.