Function logpeek::init

source ·
pub fn init(config: Config) -> Result<(), SetLoggerError>
Expand description

Initializes the logger by setting it as the global boxed logger for the log crate.

§Arguments

  • config: A Config instance that specifies the settings for the logger. Use Default::default() for the default settings.

§Returns

  • Ok(()) if the logger was successfully initialized.
  • Err(SetLoggerError) if the logger failed to initialize for any reason.

§Panics

This function will panic if it fails to create the log directory or the log file. This can happen if the user does not have the required permissions.