Skip to main content

GLOBAL_LOGGER

Static GLOBAL_LOGGER 

Source
pub static GLOBAL_LOGGER: OnceLock<Sender<Entry>>
Expand description

The global channel sender used to submit log entries to the background logging service.

Initialized once on startup by calling Service::start and storing the returned sender here via OnceLock::set. Once set, this value is immutable for the lifetime of the process.

The sender is intentionally stored as an OnceLock rather than a separate AtomicBool flag so that there is a single source of truth for whether logging is active. Code that needs to check whether logging is enabled should call logging_enabled instead of reading this directly.