You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clap (and thus presumably StructOpt) supports counting how many times a flag is passed. Counting occurrences of -v (including compressed forms like -vv) could monotonically increase the verbosity. Example code:
let filters:Vec<LevelFilter> = [LevelFilter::Error,LevelFilter::Warn,LevelFilter::Info,LevelFilter::Debug,LevelFilter::Trace,][..= std::cmp::min(args.occurrences_of("verbosity"),4].iter().cloned().collect();
Yes, I know, there's even a crate for that (clap-verbosity-flag, I think).
However, if I want to set the logging to debug, having to count how many -vs I need is just terrible UX, especially with daemons, which you don't want to run again and again, tweaking the debugging. Furthermore, the command line allows setting log levels for specific crates (which is often quite useful in larger projects ‒ which daemons often happen to be). Repetitive -v doesn't sound consistent with it.
So I'm more thinking about keeping the -l flag for logging level and -v would just set it to Debug, as a shortcut.
Users might reasonably expect the
-v
to mean verbose output. Think about how it is possible to combine together with specifying log levels explicitly.The text was updated successfully, but these errors were encountered: