defensive initializing log
This commit is contained in:
parent
b5d78283bc
commit
c1cf9bdcdf
@ -18,11 +18,13 @@ lazy_static! {
|
|||||||
let mut builder = LogBuilder::new();
|
let mut builder = LogBuilder::new();
|
||||||
builder.filter(None, LogLevelFilter::Info);
|
builder.filter(None, LogLevelFilter::Info);
|
||||||
|
|
||||||
if env::var("RUST_LOG").is_ok() {
|
if let Ok(log) = env::var("RUST_LOG") {
|
||||||
builder.parse(&env::var("RUST_LOG").unwrap());
|
builder.parse(&log);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.init().unwrap();
|
if let Ok(_) = builder.init() {
|
||||||
|
println!("logger initialized");
|
||||||
|
}
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user