pub fn init_logger(
    logger_cfg: LoggerConfig,
    firecracker_version: &str,
) -> std::result::Result<(), LoggerConfigError> {
    LOGGER
        .set_max_level(logger_cfg.level.into())
        .set_include_origin(logger_cfg.show_log_origin, logger_cfg.show_log_origin)
        .set_include_level(logger_cfg.show_level);

    let writer = FcLineWriter::new(
        open_file_nonblock(&logger_cfg.log_path)
            .map_err(|e| LoggerConfigError::InitializationFailure(e.to_string()))?,
    );
    LOGGER
        .init(
            format!("Running {} v{}", "Firecracker", firecracker_version),
            Box::new(writer),
        )
        .map_err(|e| LoggerConfigError::InitializationFailure(e.to_string()))
}
/// Configures the logger as described in `logger_cfg`.
Configures the logger as described in `logger_cfg`.
Configures the logger as described in ` logger_cfg ` .
pub fn init_logger(
    logger_cfg: LoggerConfig,
    firecracker_version: &str,
) -> std::result::Result<(), LoggerConfigError> {
    LOGGER
        .set_max_level(logger_cfg.level.into())
        .set_include_origin(logger_cfg.show_log_origin, logger_cfg.show_log_origin)
        .set_include_level(logger_cfg.show_level);
    let writer = FcLineWriter::new(
        open_file_nonblock(&logger_cfg.log_path)
            .map_err(|e| LoggerConfigError::InitializationFailure(e.to_string()))?,
    );
    LOGGER
        .init(
            format!("Running {} v{}", "Firecracker", firecracker_version),
            Box::new(writer),
        )
        .map_err(|e| LoggerConfigError::InitializationFailure(e.to_string()))
}
pub fn init_logger ( logger_cfg : LoggerConfig , firecracker_version : & str , ) -> std :: result :: Result < ( ) , LoggerConfigError > { LOGGER . set_max_level ( logger_cfg . level . into ( ) ) . set_include_origin ( logger_cfg . show_log_origin , logger_cfg . show_log_origin ) . set_include_level ( logger_cfg . show_level ) ; let writer = FcLineWriter :: new ( open_file_nonblock ( & logger_cfg . log_path ) . map_err ( | e | LoggerConfigError :: InitializationFailure ( e . to_string ( ) ) ) ? , ) ; LOGGER . init ( format ! ( " " " " firecracker_version ) , Box :: new ( writer ) , ) . map_err ( | e | LoggerConfigError :: InitializationFailure ( e . to_string ( ) ) ) }
Configures the logger as described in `logger_cfg`.
Configures the logger as described in ` logger_cfg ` .
logger_cfg
LoggerConfig
firecracker_version
&str