Fixed init error on Windows
This commit is contained in:
parent
7814984e02
commit
94d39be08b
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
@ -62,9 +62,7 @@ use errors::*;
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use iron::prelude::*;
|
use iron::prelude::*;
|
||||||
use mount::Mount;
|
use mount::Mount;
|
||||||
#[cfg(unix)]
|
use simplelog::{Level, LevelFilter, SimpleLogger, TermLogger};
|
||||||
use simplelog::SimpleLogger;
|
|
||||||
use simplelog::{Level, LevelFilter, TermLogger};
|
|
||||||
use staticfile::Static;
|
use staticfile::Static;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
@ -142,8 +140,10 @@ fn init_log(log_level: LevelFilter, options: &getopts::Matches) -> Result<()> {
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn init_log(log_level: LevelFilter, _: &getopts::Matches) -> Result<()> {
|
fn init_log(log_level: LevelFilter, _: &getopts::Matches) -> Result<()> {
|
||||||
if let Err(e) = TermLogger::init(log_level, LOG_CONFIG) {
|
if let Err(_) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||||
bail!("Error starting terminal 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