fn create_default_root_logger(
    is_async: bool,
    chan_size: Option<usize>,
    log_path: PathBuf,
) -> Result<Logger> {
    let file = OpenOptions::new()
        .read(true)
        .append(true)
        .create(true)
        .open(log_path)?;

    let decorator = slog_term::PlainDecorator::new(file);
    let drain = slog_term::FullFormat::new(decorator).build().fuse();

    if is_async {
        let async_builder = match chan_size {
            Some(chan_size_inner) => Async::new(drain).chan_size(chan_size_inner),
            None => Async::new(drain),
        };
        Ok(Logger::root(async_builder.build().fuse(), o!()))
    } else {
        Ok(Logger::root(Mutex::new(drain).fuse(), o!()))
    }
}
/// Creates a root logger with config settings.
Creates a root logger with config settings.
Creates a root logger with config settings .
fn create_default_root_logger(
    is_async: bool,
    chan_size: Option<usize>,
    log_path: PathBuf,
) -> Result<Logger> {
    let file = OpenOptions::new()
        .read(true)
        .append(true)
        .create(true)
        .open(log_path)?;
    let decorator = slog_term::PlainDecorator::new(file);
    let drain = slog_term::FullFormat::new(decorator).build().fuse();
    if is_async {
        let async_builder = match chan_size {
            Some(chan_size_inner) => Async::new(drain).chan_size(chan_size_inner),
            None => Async::new(drain),
        };
        Ok(Logger::root(async_builder.build().fuse(), o!()))
    } else {
        Ok(Logger::root(Mutex::new(drain).fuse(), o!()))
    }
}
fn create_default_root_logger ( is_async : bool , chan_size : Option < usize > , log_path : PathBuf , ) -> Result < Logger > { let file = OpenOptions :: new ( ) . read ( true ) . append ( true ) . create ( true ) . open ( log_path ) ? ; let decorator = slog_term :: PlainDecorator :: new ( file ) ; let drain = slog_term :: FullFormat :: new ( decorator ) . build ( ) . fuse ( ) ; if is_async { let async_builder = match chan_size { Some ( chan_size_inner ) => Async :: new ( drain ) . chan_size ( chan_size_inner ) , None => Async :: new ( drain ) , } ; Ok ( Logger :: root ( async_builder . build ( ) . fuse ( ) , o ! ( ) ) ) } else { Ok ( Logger :: root ( Mutex :: new ( drain ) . fuse ( ) , o ! ( ) ) ) } }
Creates a root logger with config settings.
Creates a root logger with config settings .
is_async
bool
chan_size
Option<usize>
log_path
PathBuf
is_async
bool
chan_size
Option<usize>
log_path
PathBuf