mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
logging: kill quiet option
no logging by default, enabled with -v logging by default broke fstests Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
e084e9f65b
commit
07913d1185
@ -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<String>) -> 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)
|
||||
}
|
||||
|
@ -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<String>, 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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user