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: lib.rs
    path of file: ./repos/dim/dim-core/src
    
    the code of the file until where you have to start completion: //! Dim is a media manager written in rust.
//! It uses Diesel as the ORM and rocket for the http/s server
//!
//! The project is split up into several crates:
//! * [`database`](dim-database) - Holds all the database models including some frequently used db operations
//! * [`routes`](routes) - All of the routes that we expose over http are stored in t
    
pub fn setup_logging(_debug: bool) {
    let _ = create_dir_all("logs");

    if std::env::var("RUST_LOG").is_err() {
        std::env::set_var("RUST_LOG", "info,tower_http=trace");
    }

    let log_appender = tracing_appender::rolling::daily("./logs", "dim-log.log");
    let (non_blocking_file, _guard) = tracing_appender::non_blocking(log_appender);

    let subscriber = tracing_subscriber::registry()
        .with(EnvFilter::from_default_env())
        .with(fmt::layer().with_writer(std::io::stdout))
        .with(fmt::layer().json().with_writer(non_blocking_file));

    let _ = tracing::subscriber::set_global_default(subscriber);
}