Skip to main content

logging_enabled

Function logging_enabled 

Source
pub fn logging_enabled() -> bool
Expand description

Returns true if the logging service has been initialized and is currently active.

This is the canonical way to check whether logging is enabled before performing any work related to telemetry. It reads from GLOBAL_LOGGER and avoids the need for a separate AtomicBool flag.

Used in IntoResponse to decide whether to construct an Entry for the error telemetry middleware, and in route_main to decide whether to attach the logging middleware layer.