/// Creates and returns a logging configuration derived from `config`
/// overridden by command line flags
Creates and returns a logging configuration derived from `config`
overridden by command line flags
Creates and returns a logging configuration derived from ` config ` overridden by command line flags
pub fn from_flags(config: Config) -> Result<Config, ConfigError> {
    let mut config = config;
    if LOG_TO_STDERR.is_present() {
        config.to_stderr = LOG_TO_STDERR.flag;
    }
    if LOG_TO_STDERR_PRETTY.is_present() {
        config.to_stderr_pretty = LOG_TO_STDERR.flag;
    }
    if LOG_LEVEL.is_present() {
        config.level = LOG_LEVEL.flag.clone();
    }
    if LOG_TO_DISK.is_present() {
        config.to_disk = Some(PathBuf::from(LOG_TO_DISK.flag).canonicalize()?);
    }
    Ok(config)
}
pub fn from_flags ( config : Config ) -> Result < Config , ConfigError > { let mut config = config ; if LOG_TO_STDERR . is_present ( ) { config . to_stderr = LOG_TO_STDERR . flag ; } if LOG_TO_STDERR_PRETTY . is_present ( ) { config . to_stderr_pretty = LOG_TO_STDERR . flag ; } if LOG_LEVEL . is_present ( ) { config . level = LOG_LEVEL . flag . clone ( ) ; } if LOG_TO_DISK . is_present ( ) { config . to_disk = Some ( PathBuf :: from ( LOG_TO_DISK . flag ) . canonicalize ( ) ? ) ; } Ok ( config ) }
Creates and returns a logging configuration derived from `config`
overridden by command line flags
Creates and returns a logging configuration derived from ` config ` overridden by command line flags
config
Config