about summary refs log tree commit diff stats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 14:09:15 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 14:09:15 +0200
commit0929e662cbf5cde2f0558df785830a24118c930e (patch)
treec1f5b4c3ece1e0b61c2eee50c889349262305970 /src/main.rs
parentstyle(treewide): Format (diff)
downloadyt-0929e662cbf5cde2f0558df785830a24118c930e.tar.gz
yt-0929e662cbf5cde2f0558df785830a24118c930e.zip
fix(cli/verbosity): Simplify setting the default level
Diffstat (limited to '')
-rw-r--r--src/main.rs21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/main.rs b/src/main.rs
index 5e22dc7..94c0f71 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -46,14 +46,8 @@ pub mod watch;
 async fn main() -> Result<()> {
     let args = cli::CliArgs::parse();
 
-    let verbosity: u8 = if args.verbosity == u8::MAX {
-        // the user did not specify a verbosity
-        2 // log::Level::Warn
-    } else {
-        assert!(args.verbosity > 0);
-
-        args.verbosity + 2 // log::Level::Warn
-    };
+    // The default verbosity is 1 (Warn)
+    let verbosity: u8 = args.verbosity + 1;
 
     stderrlog::new()
         .module(module_path!())
@@ -68,12 +62,11 @@ async fn main() -> Result<()> {
 
     info!("Using verbosity level: '{} ({})'", verbosity, {
         match verbosity {
-            0 => "Off",
-            1 => "Error",
-            2 => "Warn",
-            3 => "Info",
-            4 => "Debug",
-            5.. => "Trace",
+            0 => "Error",
+            1 => "Warn",
+            2 => "Info",
+            3 => "Debug",
+            4.. => "Trace",
         }
     });