fn create_logger<'a>(matches: &clap::ArgMatches<'a>) -> slog::Logger {
    let mut builder = TerminalLoggerBuilder::new();

    // Default severity level is info.
    builder.level(Severity::Info);
    // Write all logs to stderr.
    builder.destination(Destination::Stdout); // FIXME write to stdErr

    // If in debug mode, change severity level to debug.
    if matches.is_present("debug") {
        builder.level(Severity::Debug);
    }

    // According to `sloggers-0.3.2` source code, the function doesn't return an error at all.
    // There should be no problem unwrapping here. It has a return type `Result` because it's a
    // signature for `sloggers::Build` trait.
    builder.build().expect("BUG: TerminalLoggerBuilder::build shouldn't return an error.")
}
/// Create a logger to be used throughout cfnts.
Create a logger to be used throughout cfnts.
Create a logger to be used throughout cfnts .
fn create_logger<'a>(matches: &clap::ArgMatches<'a>) -> slog::Logger {
    let mut builder = TerminalLoggerBuilder::new();
    // Default severity level is info.
    builder.level(Severity::Info);
    // Write all logs to stderr.
    builder.destination(Destination::Stdout); // FIXME write to stdErr
    // If in debug mode, change severity level to debug.
    if matches.is_present("debug") {
        builder.level(Severity::Debug);
    }
    // According to `sloggers-0.3.2` source code, the function doesn't return an error at all.
    // There should be no problem unwrapping here. It has a return type `Result` because it's a
    // signature for `sloggers::Build` trait.
    builder.build().expect("BUG: TerminalLoggerBuilder::build shouldn't return an error.")
}
fn create_logger < ' a > ( matches : & clap :: ArgMatches < ' a > ) -> slog :: Logger { let mut builder = TerminalLoggerBuilder :: new ( ) ; // Default severity level is info. builder . level ( Severity :: Info ) ; // Write all logs to stderr. builder . destination ( Destination :: Stdout ) ; // FIXME write to stdErr // If in debug mode, change severity level to debug. if matches . is_present ( " " ) { builder . level ( Severity :: Debug ) ; } // According to `sloggers-0.3.2` source code, the function doesn't return an error at all. // There should be no problem unwrapping here. It has a return type `Result` because it's a // signature for `sloggers::Build` trait. builder . build ( ) . expect ( " " ) }
Create a logger to be used throughout cfnts.
Create a logger to be used throughout cfnts .
matches
&clap::ArgMatches<'a>
matches
&clap::ArgMatches<'a>