From 07913d1185aad0aa730804392c39a138beb08931 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 15 Jul 2024 23:16:55 -0400 Subject: [PATCH] logging: kill quiet option no logging by default, enabled with -v logging by default broke fstests Signed-off-by: Kent Overstreet --- src/commands/list.rs | 6 +----- src/commands/mount.rs | 6 +----- src/logging.rs | 15 ++++++--------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/commands/list.rs b/src/commands/list.rs index b1bf144a..33209995 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -152,10 +152,6 @@ pub struct Cli { #[arg(short, long, action = clap::ArgAction::Set, default_value_t=stdout().is_terminal())] colorize: bool, - /// Quiet mode - #[arg(short, long)] - quiet: bool, - /// Verbose mode #[arg(short, long, action = clap::ArgAction::Count)] verbose: u8, @@ -205,7 +201,7 @@ pub fn list(argv: Vec) -> Result<()> { let opt = Cli::parse_from(argv); // TODO: centralize this on the top level CLI - logging::setup(opt.quiet, opt.verbose, opt.colorize); + logging::setup(opt.verbose, opt.colorize); cmd_list_inner(&opt) } diff --git a/src/commands/mount.rs b/src/commands/mount.rs index 235a1825..e01f5388 100644 --- a/src/commands/mount.rs +++ b/src/commands/mount.rs @@ -250,10 +250,6 @@ pub struct Cli { #[arg(short, long, action = clap::ArgAction::Set, default_value_t=stdout().is_terminal())] colorize: bool, - /// Quiet mode - #[arg(short, long)] - quiet: bool, - /// Verbose mode #[arg(short, long, action = clap::ArgAction::Count)] verbose: u8, @@ -383,7 +379,7 @@ pub fn mount(mut argv: Vec, symlink_cmd: Option<&str>) -> Result<()> { let cli = Cli::parse_from(argv); // TODO: centralize this on the top level CLI - logging::setup(cli.quiet, cli.verbose, cli.colorize); + logging::setup(cli.verbose, cli.colorize); cmd_mount_inner(&cli) } diff --git a/src/logging.rs b/src/logging.rs index dee99881..98ca091f 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -1,15 +1,12 @@ use env_logger::WriteStyle; use log::LevelFilter; -pub fn setup(quiet: bool, verbose: u8, color: bool) { - let level_filter = if quiet { - LevelFilter::Off - } else { - match verbose { - 0 => LevelFilter::Info, - 1 => LevelFilter::Debug, - _ => LevelFilter::Trace, - } +pub fn setup(verbose: u8, color: bool) { + let level_filter = match verbose { + 0 => LevelFilter::Off, + 1 => LevelFilter::Info, + 2 => LevelFilter::Debug, + _ => LevelFilter::Trace, }; let style = if color {