pub fn intiailize_logger() -> Result<()> {
    log_panics::init();

    let xdg_dirs = xdg::BaseDirectories::with_prefix("lanta")?;
    let log_path = xdg_dirs
        .place_data_file("lanta.log")
        .context("Could not create log file")?;

    fern::Dispatch::new()
        .format(|out, message, record| {
            out.finish(format_args!(
                "[{}] [{}] {}",
                time::now().rfc3339(),
                record.level(),
                message
            ))
        })
        .level(log::LevelFilter::Trace)
        .chain(std::io::stdout())
        .chain(fern::log_file(&log_path)?)
        .apply()?;

    Ok(())
}
/// Initializes a logger using the default configuration.
///
/// Outputs to stdout and `$XDG_DATA/lanta/lanta.log` by default.
/// You should feel free to initialize your own logger, instead of using this.
Initializes a logger using the default configuration.
Outputs to stdout and `$XDG_DATA/lanta/lanta.log` by default.
You should feel free to initialize your own logger, instead of using this.
Initializes a logger using the default configuration . Outputs to stdout and ` $XDG_DATA / lanta / lanta . log ` by default . You should feel free to initialize your own logger instead of using this .
pub fn intiailize_logger() -> Result<()> {
    log_panics::init();
    let xdg_dirs = xdg::BaseDirectories::with_prefix("lanta")?;
    let log_path = xdg_dirs
        .place_data_file("lanta.log")
        .context("Could not create log file")?;
    fern::Dispatch::new()
        .format(|out, message, record| {
            out.finish(format_args!(
                "[{}] [{}] {}",
                time::now().rfc3339(),
                record.level(),
                message
            ))
        })
        .level(log::LevelFilter::Trace)
        .chain(std::io::stdout())
        .chain(fern::log_file(&log_path)?)
        .apply()?;
    Ok(())
}
pub fn intiailize_logger ( ) -> Result < ( ) > { log_panics :: init ( ) ; let xdg_dirs = xdg :: BaseDirectories :: with_prefix ( " " ) ? ; let log_path = xdg_dirs . place_data_file ( " " ) . context ( " " ) ? ; fern :: Dispatch :: new ( ) . format ( | out , message , record | { out . finish ( format_args ! ( " " time now ( ) rfc3339 ( ) record level ( ) message ) ) } ) . level ( log :: LevelFilter :: Trace ) . chain ( std :: io :: stdout ( ) ) . chain ( fern :: log_file ( & log_path ) ? ) . apply ( ) ? ; Ok ( ( ) ) }
Initializes a logger using the default configuration.
Initializes a logger using the default configuration .