mirror of
https://github.com/agersant/polaris
synced 2025-03-01 13:57:14 +00:00
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 iron::prelude::*;
|
||||
use mount::Mount;
|
||||
#[cfg(unix)]
|
||||
use simplelog::SimpleLogger;
|
||||
use simplelog::{Level, LevelFilter, TermLogger};
|
||||
use simplelog::{Level, LevelFilter, SimpleLogger, TermLogger};
|
||||
use staticfile::Static;
|
||||
use std::path::Path;
|
||||
use std::sync::mpsc::channel;
|
||||
|
@ -142,8 +140,10 @@ fn init_log(log_level: LevelFilter, options: &getopts::Matches) -> Result<()> {
|
|||
|
||||
#[cfg(windows)]
|
||||
fn init_log(log_level: LevelFilter, _: &getopts::Matches) -> Result<()> {
|
||||
if let Err(e) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||
bail!("Error starting terminal logger: {}", e);
|
||||
if let Err(_) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||
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