Skip to content

Commit c28874b

Browse files
committed
Bump version
1 parent 9edb26e commit c28874b

File tree

6 files changed

+32
-27
lines changed

6 files changed

+32
-27
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77

8+
## 2.0.0-3.0 - 2017-04-02
9+
### Changed
10+
11+
* Update dependencies
12+
813
## 2.0.0-1.0 - 2017-03-05
914
### Changed
1015

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "slog-envlogger"
4-
version = "2.0.0-1.0"
4+
version = "2.0.0-3.0"
55
authors = ["The Rust Project Developers", "Dawid Ciężarkiewicz <dpc@dpc.pw>"]
66
license = "MIT/Apache-2.0"
77
readme = "README.md"
@@ -16,12 +16,12 @@ Port of de facto standard logger implementation for Rust, to `slog-rs` framework
1616
path = "src/lib.rs"
1717

1818
[dependencies]
19-
slog = ">= 2.0.0-1.0, < 2.0.0-2"
19+
slog = "~2.0.0-3"
2020
regex = "0.1"
21-
slog-term = ">= 2.0.0-1, < 2.0.0-2"
22-
slog-stdlog = ">= 2.0.0-0, < 2.0.0-1"
23-
slog-scope = ">= 2.0.0-1, < 2.0.0-2"
24-
slog-async = ">= 2.0.0-1, < 2.0.0-2"
21+
slog-term = "~2.0.0-3"
22+
slog-stdlog = "~2.0.0-3"
23+
slog-scope = "~2.0.0-3"
24+
slog-async = "~2.0.0-3"
2525
log = "0.3.6"
2626

2727
[[test]]

examples/proper.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ extern crate slog_scope;
55
extern crate slog_async;
66

77
/// Import longer-name versions of macros only to not collide with legacy `log`
8-
#[macro_use(slog_error, slog_info, slog_trace, slog_log, o, slog_record,
9-
slog_record_static, slog_b)]
8+
#[macro_use(slog_error, slog_info, slog_trace, slog_log, slog_o, slog_record,
9+
slog_record_static, slog_b, slog_kv)]
1010
extern crate slog;
1111

1212
use slog::Drain;
@@ -25,21 +25,19 @@ fn main() {
2525
).build().fuse()
2626
));
2727

28-
let root_logger = slog::Logger::root(Arc::new(drain.fuse()), o!("build" => "8jdkj2df", "version" => "0.1.5"));
28+
let root_logger = slog::Logger::root(Arc::new(drain.fuse()),
29+
slog_o!("build" => "8jdkj2df", "version" => "0.1.5"));
2930

3031
slog_stdlog::init().unwrap();
3132

3233
//slog_scope::set_global_logger(root_logger.clone().into_erased());
33-
slog_scope::scope(
34-
root_logger.clone().into_erased(),
35-
|| {
36-
37-
slog_error!(root_logger, "slog error");
38-
error!("log error");
39-
slog_info!(root_logger, "slog info");
40-
info!("log info");
41-
slog_trace!(root_logger, "slog trace");
42-
trace!("log trace");
43-
}
44-
);
34+
slog_scope::scope(root_logger.clone().into_erased(), || {
35+
36+
slog_error!(root_logger, "slog error");
37+
error!("log error");
38+
slog_info!(root_logger, "slog info");
39+
info!("log info");
40+
slog_trace!(root_logger, "slog trace");
41+
trace!("log trace");
42+
});
4543
}

examples/scopes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ extern crate slog_stdlog;
22
extern crate slog_envlogger;
33
extern crate slog_scope;
44

5-
#[macro_use(o)]
5+
#[macro_use(o, kv)]
66
extern crate slog;
77

88
#[macro_use]
99
extern crate log;
1010

1111
fn main() {
12-
slog_envlogger::init().unwrap();
12+
let _guard = slog_envlogger::init().unwrap();
1313

1414
error!("log error");
1515

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,17 @@ pub fn new<T : Drain>(d : T) -> EnvLogger<T> {
256256
/// It's an easy first step, but using `init()` you're not gaining almost
257257
/// anything that `slog` has to offer, so I highly encourage to use `new()`
258258
/// instead and explicitly configure your loggers.
259-
pub fn init() -> std::result::Result<(), log::SetLoggerError> {
259+
pub fn init() -> std::result::Result<slog_scope::GlobalLoggerGuard, log::SetLoggerError> {
260260
let drain = slog_term::CompactFormat::new(
261261
slog_term::TermDecorator::new().stderr().build()
262262
).build();
263263
let drain = new(drain);
264264
let drain = sync::Mutex::new(drain.fuse());
265265

266-
slog_scope::set_global_logger(Logger::root(drain.fuse(), o!()).into_erased());
267-
slog_stdlog::init()
266+
let guard = slog_scope::set_global_logger(Logger::root(drain.fuse(), o!()).into_erased());
267+
slog_stdlog::init()?;
268+
269+
Ok(guard)
268270
}
269271

270272
/// Parse a logging specification string (e.g: "crate1,crate2::mod3,crate3::x=error/foo")

tests/regexp_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
}
1515

1616
fn child_main() {
17-
slog_envlogger::init().unwrap();
17+
let _guard =slog_envlogger::init().unwrap();
1818
info!("XYZ Message");
1919
}
2020

0 commit comments

Comments
 (0)