Skip to content

Commit 8b54760

Browse files
Fixed bug in updating to newer log framework version
1 parent bb321dc commit 8b54760

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "simplog"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
authors = ["Andrew Mackenzie <andrew@mackenzie-serres.net>"]
55
description = "An extremely small and simple logger that has levels of output"
66
license = "MIT"
@@ -9,5 +9,6 @@ license = "MIT"
99
name = "simplog"
1010
path = "src/lib.rs"
1111

12-
[dependencies]
13-
log = "0.4.6"
12+
[dependencies.log]
13+
version = "0.4.6"
14+
features = ["std"]

src/simplog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub struct SimpleLogger {
77
log_level: Level
88
}
99

10-
static SIMPLOGGER: &Log = &SimpleLogger { log_level: DEFAULT_LOG_LEVEL };
1110
const DEFAULT_LOG_LEVEL: Level = Level::Error;
1211

1312
/// Initialize the SimpleLogger using the 'init()' function by passing it an Option<&str>
@@ -30,8 +29,8 @@ const DEFAULT_LOG_LEVEL: Level = Level::Error;
3029
/// ```
3130
impl SimpleLogger {
3231
pub fn init(arg: Option<&str>) {
33-
log::set_logger(SIMPLOGGER).unwrap();
3432
let level = parse_log_level(arg);
33+
log::set_boxed_logger(Box::new(SimpleLogger{ log_level: level })).unwrap();
3534
log::set_max_level(level.to_level_filter());
3635
}
3736
}

0 commit comments

Comments
 (0)