diff options
| -rw-r--r-- | mullvad_daemon/src/cli.rs | 22 | ||||
| -rw-r--r-- | mullvad_daemon/src/main.rs | 21 |
2 files changed, 26 insertions, 17 deletions
diff --git a/mullvad_daemon/src/cli.rs b/mullvad_daemon/src/cli.rs index 0d879de64d..670a2bf28b 100644 --- a/mullvad_daemon/src/cli.rs +++ b/mullvad_daemon/src/cli.rs @@ -11,7 +11,7 @@ pub struct Config { pub fn get_config() -> Config { let app = create_app(); let matches = app.get_matches(); - + let log_level = match matches.occurrences_of("v") { 0 => log::LogLevelFilter::Info, 1 => log::LogLevelFilter::Debug, @@ -30,12 +30,16 @@ fn create_app() -> App<'static, 'static> { .version(crate_version!()) .author(crate_authors!()) .about(crate_description!()) - .arg(Arg::with_name("v") - .short("v") - .multiple(true) - .help("Sets the level of verbosity.")) - .arg(Arg::with_name("log_file") - .long("log") - .takes_value(true) - .help("Activates file logging to the given path")) + .arg( + Arg::with_name("v") + .short("v") + .multiple(true) + .help("Sets the level of verbosity."), + ) + .arg( + Arg::with_name("log_file") + .long("log") + .takes_value(true) + .help("Activates file logging to the given path"), + ) } diff --git a/mullvad_daemon/src/main.rs b/mullvad_daemon/src/main.rs index 3e9900d782..74d6801cff 100644 --- a/mullvad_daemon/src/main.rs +++ b/mullvad_daemon/src/main.rs @@ -483,14 +483,19 @@ fn init_logger(log_level: log::LogLevelFilter, log_file: Option<&PathBuf>) -> Re "mio", ]; let mut config = fern::Dispatch::new() - .format(|out, message, record| { - out.finish(format_args!("{}[{}][{}] {}", - chrono::Local::now() - .format("[%Y-%m-%d %H:%M:%S]"), - record.target(), - record.level(), - message)) - }) + .format( + |out, message, record| { + out.finish( + format_args!( + "{}[{}][{}] {}", + chrono::Local::now().format("[%Y-%m-%d %H:%M:%S]"), + record.target(), + record.level(), + message + ), + ) + }, + ) .level(log_level) .chain(std::io::stdout()); for silenced_crate in &silenced_crates { |
