Implement suggestions
This commit is contained in:
parent
0224a5dee3
commit
b878ac555e
1 changed files with 8 additions and 8 deletions
12
src/main.rs
12
src/main.rs
|
@ -124,16 +124,16 @@ fn daemonize(options: &getopts::Matches) -> Result<()> {
|
|||
#[cfg(unix)]
|
||||
fn init_log(log_level: LevelFilter, options: &getopts::Matches) -> Result<()> {
|
||||
if options.opt_present("f") {
|
||||
if let Err(_) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||
if let Err(e) = SimpleLogger::init(log_level, LOG_CONFIG) {
|
||||
bail!("Error starting terminal logger: {}", e);
|
||||
};
|
||||
};
|
||||
if let Err(e) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||
println!("Error starting terminal logger: {}", e);
|
||||
} else {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(e) = SimpleLogger::init(log_level, LOG_CONFIG) {
|
||||
bail!("Error starting simple logger: {}", e);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue