pub fn init_logger(
    logger_cfg: LoggerConfig,
    instance_info: &InstanceInfo,
) -> 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{}",
                instance_info.app_name, instance_info.vmm_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,
    instance_info: &InstanceInfo,
) -> 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{}",
                instance_info.app_name, instance_info.vmm_version
            ),
            Box::new(writer),
        )
        .map_err(|e| LoggerConfigError::InitializationFailure(e.to_string()))
}
pub fn init_logger ( logger_cfg : LoggerConfig , instance_info : & InstanceInfo , ) -> 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 ! ( " " instance_info app_name instance_info vmm_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
instance_info
&InstanceInfo
logger_cfg
LoggerConfig
instance_info
&InstanceInfo