You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: logger.rs
    path of file: ./repos/youki/tests/contest/contest/src
    
    the code of the file until where you have to start completion: use anyhow::{Context, Result};
use std::borrow::Cow;
use std::str::FromStr;
use tracing::metadata::LevelFilter;

const LOG_LEVEL_ENV_NAME: &str = "YOUKI_INTEGRATION_LOG_LEVEL";

/// Initialize the logger, must be called before accessing the logge
    
fn detect_log_level(is_debug: bool) -> Result<LevelFilter> {
    let filter: Cow<str> = if is_debug {
        "debug".into()
    } else if let Ok(level) = std::env::var(LOG_LEVEL_ENV_NAME) {
        level.into()
    } else {
        "off".into()
    };

    Ok(LevelFilter::from_str(filter.as_ref())?)
}