Add -v option to print out logs (>= info) (#164)
This commit is contained in:
committed by
Roey Darwish Dror
parent
680f9a6d19
commit
232c886be6
@@ -1,3 +1,5 @@
|
||||
#![allow(clippy::cognitive_complexity)]
|
||||
|
||||
mod config;
|
||||
mod ctrlc;
|
||||
mod error;
|
||||
@@ -14,6 +16,7 @@ use self::error::{Error, ErrorKind};
|
||||
use self::report::Report;
|
||||
use self::steps::*;
|
||||
use self::terminal::*;
|
||||
use env_logger::Env;
|
||||
use failure::{Fail, ResultExt};
|
||||
use log::debug;
|
||||
#[cfg(feature = "self-update")]
|
||||
@@ -73,7 +76,11 @@ fn run() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
|
||||
env_logger::init();
|
||||
let mut env = Env::default();
|
||||
if config.verbose() {
|
||||
env = env.filter_or("LOG_LEVEL", "info");
|
||||
}
|
||||
env_logger::init_from_env(env);
|
||||
|
||||
let git = git::Git::new();
|
||||
let mut git_repos = git::Repositories::new(&git);
|
||||
|
||||
Reference in New Issue
Block a user