Make verbose work more like expected
This commit is contained in:
parent
cfd4d41a73
commit
5d14b50531
1 changed files with 7 additions and 3 deletions
10
src/main.rs
10
src/main.rs
|
@ -35,8 +35,8 @@ struct Config {
|
|||
output_dir: Option<String>,
|
||||
#[arg(required = true)]
|
||||
date: String,
|
||||
#[arg(short, long)]
|
||||
verbose: bool,
|
||||
#[arg(short, long, action = clap::ArgAction::Count)]
|
||||
verbose: u8,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
@ -49,7 +49,11 @@ async fn main() -> Result<()> {
|
|||
output_dir,
|
||||
} = Config::parse();
|
||||
|
||||
let level = if verbose { "debug" } else { "off" };
|
||||
let level = match verbose {
|
||||
0 => "off",
|
||||
1 => "debug",
|
||||
_ => "trace",
|
||||
};
|
||||
env::set_var("RUST_LOG", format!("{}={}", module_path!(), level));
|
||||
env_logger::init();
|
||||
|
||||
|
|
Loading…
Reference in a new issue