pub fn init_logging(path: impl Into<PathBuf>) -> flexi_logger::LoggerHandle {
    use flexi_logger::{FileSpec, LevelFilter, LogSpecification, Logger};
    let modules = &["distant", "distant_core"];

    // Disable logging for everything but our binary, which is based on verbosity
    let mut builder = LogSpecification::builder();
    builder.default(LevelFilter::Off);

    // For each module, configure logging
    for module in modules {
        builder.module(module, LevelFilter::Trace);
    }

    // Create our logger, but don't initialize yet
    let logger = Logger::with(builder.build())
        .format_for_files(flexi_logger::opt_format)
        .log_to_file(FileSpec::try_from(path).expect("Failed to create log file spec"));

    logger.start().expect("Failed to initialize logger")
}
/// Initializes logging (should only call once)
Initializes logging (should only call once)
Initializes logging ( should only call once )
pub fn init_logging(path: impl Into<PathBuf>) -> flexi_logger::LoggerHandle {
    use flexi_logger::{FileSpec, LevelFilter, LogSpecification, Logger};
    let modules = &["distant", "distant_core"];
    // Disable logging for everything but our binary, which is based on verbosity
    let mut builder = LogSpecification::builder();
    builder.default(LevelFilter::Off);
    // For each module, configure logging
    for module in modules {
        builder.module(module, LevelFilter::Trace);
    }
    // Create our logger, but don't initialize yet
    let logger = Logger::with(builder.build())
        .format_for_files(flexi_logger::opt_format)
        .log_to_file(FileSpec::try_from(path).expect("Failed to create log file spec"));
    logger.start().expect("Failed to initialize logger")
}
pub fn init_logging ( path : impl Into < PathBuf > ) -> flexi_logger :: LoggerHandle { use flexi_logger :: { FileSpec , LevelFilter , LogSpecification , Logger } ; let modules = & [ " " , " " ] ; // Disable logging for everything but our binary, which is based on verbosity let mut builder = LogSpecification :: builder ( ) ; builder . default ( LevelFilter :: Off ) ; // For each module, configure logging for module in modules { builder . module ( module , LevelFilter :: Trace ) ; } // Create our logger, but don't initialize yet let logger = Logger :: with ( builder . build ( ) ) . format_for_files ( flexi_logger :: opt_format ) . log_to_file ( FileSpec :: try_from ( path ) . expect ( " " ) ) ; logger . start ( ) . expect ( " " ) }
Initializes logging (should only call once)
Initializes logging ( should only call once )
path
impl Into<PathBuf>