Skip to main content

init_logging

Function init_logging 

Source
pub fn init_logging(config: &LoggingConfig) -> Result<LogGuard>
Expand description

Initialize logging with the given configuration

Returns a guard that must be held for the lifetime of the application to ensure logs are flushed properly.

§Errors

Returns an error if file logging is configured but the log directory cannot be created.

§Panics

Panics if the environment filter directives are malformed (only when RUST_LOG is set).