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: file_logger.rs
    path of file: ./repos/firezone/rust/connlib/clients/shared/src
    
    the code of the file until where you have to start completion: //! Connlib File Logger
//!
//! This module implements a file-based logger for connlib using tracing-appender.
//!
//! The log files are rotated hourly.
//!
//! Since these will be leaving the user's device, these logs should contain *only*
//! the necessary debugging information, and **not** any sensitive information,
//! including but not limited to:
//! - WiFi SSIDs
//! - Location information
//! - Device names
//! - Device serials
//! - MAC addresses

use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex, MutexGuard};
use std::{fs, io};

use time::OffsetDateTime;
use tracing::Subscriber;
use tracing_appender::non_blocking::{NonBlocking, WorkerGuard};
use tracing_subscriber::Layer;

const LOG_FILE_BASE_NAME: &str = "connlib";

//
    
    fn create_new_writer(&self) -> io::Result<(fs::File, String)> {
        let format =
            time::format_description::parse("[year]-[month]-[day]-[hour]-[minute]-[second]")
                .expect("static format description to be valid");
        let date = OffsetDateTime::now_utc()
            .format(&format)
            .expect("static format description to be valid");

        let filename = format!("{LOG_FILE_BASE_NAME}.{date}.log");

        let path = self.directory.join(&filename);
        let mut open_options = fs::OpenOptions::new();
        open_options.append(true).create(true);

        let new_file = open_options.open(path.as_path());
        if new_file.is_err() {
            if let Some(parent) = path.parent() {
                fs::create_dir_all(parent)?;
                let file = open_options.open(path)?;

                return Ok((file, filename));
            }
        }

        let file = new_file?;

        Ok((file, filename))
    }