fix: warn of unused loglevel
Some checks are pending
Conventional Commits / Conventional Commits (push) Waiting to run
Some checks are pending
Conventional Commits / Conventional Commits (push) Waiting to run
Fix: #15 Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
6e479e7ad2
commit
3f632969a9
1 changed files with 10 additions and 3 deletions
|
@ -35,10 +35,13 @@ async fn main() -> io::Result<()> {
|
|||
|
||||
let matches = cli::build_cli().get_matches();
|
||||
|
||||
// TODO
|
||||
/// If the users inputs more -v flags than we have log levels, send them a
|
||||
/// message informing them.
|
||||
let mut very_bose = false;
|
||||
|
||||
match matches
|
||||
.get_one::<u8>("verbose")
|
||||
.expect("Count's are defaulted")
|
||||
.expect("Counts aren't defaulted")
|
||||
{
|
||||
0 => env::set_var("RUST_LOG", "error"),
|
||||
1 => env::set_var("RUST_LOG", "warn"),
|
||||
|
@ -46,7 +49,7 @@ async fn main() -> io::Result<()> {
|
|||
3 => env::set_var("RUST_LOG", "debug"),
|
||||
4 => env::set_var("RUST_LOG", "trace"),
|
||||
_ => {
|
||||
log::trace!("More than four -v flags don't increase log level.");
|
||||
very_bose = true;
|
||||
env::set_var("RUST_LOG", "trace")
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +64,10 @@ async fn main() -> io::Result<()> {
|
|||
.init();
|
||||
}
|
||||
|
||||
if very_bose {
|
||||
log::trace!("More than four -v flags don't increase log level.");
|
||||
}
|
||||
|
||||
if let Some(name) = matches.get_one::<String>("name") {
|
||||
host_name = name.to_owned();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue