Skip to main content

init

Function init 

Source
pub fn init() -> Result<(), ServerError>
Expand description

Initialize the process-global tracing subscriber for production server output, and bridge the log facade into it.

Events are written as JSON to stdout. AION_LOG takes precedence over RUST_LOG, and the subscriber falls back to info when neither is set.

§Errors

Returns ServerError when the configured filter directive is invalid, when another log logger has already been installed, or when another tracing subscriber has already been installed. Both collisions are real double-initialization bugs — a process with two loggers has already lost half its diagnostics — so they are propagated, never swallowed.