fix --quit not conflicting with --info and use default value for log level
This commit is contained in:
parent
7f3adc9bc2
commit
4a3fd978a4
13
src/main.rs
13
src/main.rs
@ -1,8 +1,8 @@
|
|||||||
mod action;
|
mod action;
|
||||||
mod file;
|
mod file;
|
||||||
|
mod logger;
|
||||||
mod os_string_builder;
|
mod os_string_builder;
|
||||||
mod server;
|
mod server;
|
||||||
mod logger;
|
|
||||||
|
|
||||||
use crate::action::{Action, FileAction, ServerActions};
|
use crate::action::{Action, FileAction, ServerActions};
|
||||||
use crate::file::{FileMatcher, FileNameInfo};
|
use crate::file::{FileMatcher, FileNameInfo};
|
||||||
@ -121,7 +121,16 @@ enum OldVersionPolicy {
|
|||||||
fn main() -> Result<(), String> {
|
fn main() -> Result<(), String> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let logger = Logger::default();
|
let logger = Logger {
|
||||||
|
//all the below options are conflicting with each other so an if else is fine
|
||||||
|
level: if args.quiet {
|
||||||
|
LogLevel::Error
|
||||||
|
} else if args.info {
|
||||||
|
LogLevel::Debug
|
||||||
|
} else {
|
||||||
|
args.log_level
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let mut configured_servers = LazyCell::new(parse_server_configuration_from_env);
|
let mut configured_servers = LazyCell::new(parse_server_configuration_from_env);
|
||||||
let servers = args
|
let servers = args
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user