Skip to main content

init_file_logging

Function init_file_logging 

Source
pub fn init_file_logging(cfg: &LoggingConfig) -> Result<Option<WorkerGuard>>
Expand description

Initialise the file logging facility. Returns a WorkerGuard that the caller MUST keep alive for the lifetime of the process โ€” when dropped it flushes the in-memory buffer to disk. Returns None when logging is disabled.

ยงErrors

  • The configured log directory cannot be created.
  • The rolling file appender cannot be constructed.