Skip to content

Commit 216967b

Browse files
committed
Fix log env var parsing
1 parent ccda270 commit 216967b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

blacksmith/src/main.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{env, io, path::Path, process};
1+
use std::{io, path::Path, process};
22

33
use mdbook::{
44
errors::Error,
@@ -12,13 +12,7 @@ const CACHE_TTL_SECONDS: u64 = 3600; // 1 hour
1212

1313
fn main() {
1414
// If RUST_LOG is present use that, else default to info level printing.
15-
if let Ok(v) = env::var("RUST_LOG") {
16-
env_logger::init_from_env(v);
17-
} else {
18-
env_logger::builder()
19-
.filter_level(log::LevelFilter::Info)
20-
.init();
21-
}
15+
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
2216

2317
macro_rules! log_unwrap {
2418
($result:expr) => {

0 commit comments

Comments
 (0)