Skip to main content

Module log

Module log 

Source
Expand description

The console log backend. init installs Encore’s logger as the log crate’s global: each record at info and up, and the runtime’s own lines RUST_LOG (else ENCORE_RUNTIME_LOG) enables, prints on stderr in the Encore log format, with the trace and span ids of Context::current, for the log collector. ENCORE_LOG_FORMAT and ENCORE_NOLOG override the format. The runtime’s lines (the encore and encore_* crates’) log under encore.runtime, their target in encore.runtime.target.

Use init when the app logs through log. An app owning the global composes logger into its own log::Log.

Functions§

init
Installs Encore’s logger as the log crate’s global logger. Idempotent; panics if another global logger is installed.
logger
Encore’s logger, for apps composing their own log::Log.