/// Generate log size by combining all config elements. Returns error on failure.
Generate log size by combining all config elements. Returns error on failure.
Generate log size by combining all config elements . Returns error on failure .
fn make_log_size(file_cfg: &Option<SpuConfigFile>) -> Result<String, IoError> {
        let mut log_size = None;
        // 1) environment variable (optional field, ignore errors)
        if let Ok(log_size_str) = env::var(FLV_LOG_SIZE) {
            log_size = Some(log_size_str);
        }
        // 2) config file
        if log_size.is_none() && file_cfg.is_some() {
            log_size = file_cfg.as_ref().unwrap().log_size();
        }
        // 3) unwrap or use default
        Ok(log_size.unwrap_or(SPU_LOG_SIZE.to_owned()))
    }
fn make_log_size ( file_cfg : & Option < SpuConfigFile > ) -> Result < String , IoError > { let mut log_size = None ; // 1) environment variable (optional field, ignore errors) if let Ok ( log_size_str ) = env :: var ( FLV_LOG_SIZE ) { log_size = Some ( log_size_str ) ; } // 2) config file if log_size . is_none ( ) && file_cfg . is_some ( ) { log_size = file_cfg . as_ref ( ) . unwrap ( ) . log_size ( ) ; } // 3) unwrap or use default Ok ( log_size . unwrap_or ( SPU_LOG_SIZE . to_owned ( ) ) ) }
Generate log size by combining all config elements.
Generate log size by combining all config elements .
file_cfg
&Option<SpuConfigFile>