/// Generate log base dir by combining all config elements. Returns error on failure.
Generate log base dir by combining all config elements. Returns error on failure.
Generate log base dir by combining all config elements . Returns error on failure .
fn make_log_base_dir(file_cfg: &Option<SpuConfigFile>) -> Result<PathBuf, IoError> {
        let mut log_base_dir = None;
        // 1) environment variable (optional field, ignore errors)
        if let Ok(log_base_dir_str) = env::var(FLV_LOG_BASE_DIR) {
            log_base_dir = Some(PathBuf::from(log_base_dir_str));
        }
        // 2) config file
        if log_base_dir.is_none() && file_cfg.is_some() {
            log_base_dir = file_cfg.as_ref().unwrap().log_base_dir();
        }
        // 3) unwrap or use default
        Ok(log_base_dir.unwrap_or(PathBuf::from(SPU_LOG_BASE_DIR)))
    }
fn make_log_base_dir ( file_cfg : & Option < SpuConfigFile > ) -> Result < PathBuf , IoError > { let mut log_base_dir = None ; // 1) environment variable (optional field, ignore errors) if let Ok ( log_base_dir_str ) = env :: var ( FLV_LOG_BASE_DIR ) { log_base_dir = Some ( PathBuf :: from ( log_base_dir_str ) ) ; } // 2) config file if log_base_dir . is_none ( ) && file_cfg . is_some ( ) { log_base_dir = file_cfg . as_ref ( ) . unwrap ( ) . log_base_dir ( ) ; } // 3) unwrap or use default Ok ( log_base_dir . unwrap_or ( PathBuf :: from ( SPU_LOG_BASE_DIR ) ) ) }
Generate log base dir by combining all config elements.
Generate log base dir by combining all config elements .
file_cfg
&Option<SpuConfigFile>