Skip to main content

install_log_bridge

Function install_log_bridge 

Source
pub(crate) fn install_log_bridge() -> bool
Expand description

Route log crate records into tracing, at info and above.

The subscriber is built by hand (registry()...set_global_default), which does not install the log -> tracing bridge that .init() would. So every record from a dependency that logs through the log crate was dropped, at every level: mdns-sd included, whose error!("bind a socket to {}: {}. Skipped.") is exactly what was missing when an instance could hear its peers and not be heard (Area54, 2026-10-02), and which cost several cloud round trips to find by hand.

The cap is Info: the log macros skip anything above it before formatting, so the chatty debug!/trace! records of mdns-sd, hyper and friends cost nothing, and the EnvFilter below still decides what is written. Returns whether the bridge was installed (it is not if another log logger already is).