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