Skip to content

Commit 78bb614

Browse files
committed
Implement Drain::flush for Json
Pinned to the branch used in slog-rs/slog#349, so that must be accepted first. The 'pretty' example is pinned to use the branch in slog-rs/async#39, so that must also be accepted first.
1 parent 4da814f commit 78bb614

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

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

77
## [Unreleased]
8+
* Implement `Drain::flush` method added in [slog-rs/slog#349]
9+
10+
[slog-rs/slog#349]: https://github.com/slog-rs/slog/pull/349
811

912
## 2.6.0 - 2022-02-20
1013
### Changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ dynamic-keys = ["slog/dynamic-keys"]
2525
default = []
2626

2727
[dependencies]
28-
slog = { version = "2.1.1" }
28+
slog = { git = "https://github.com/Techcable/slog.git", branch = "feature/simple-flush-method" }
2929
serde_json = "1"
3030
serde = "1"
3131
erased-serde = {version = "0.3", optional = true }
3232
time = { version = "0.3.6", features = ["formatting"] }
3333

3434
[dev-dependencies]
35-
slog-async = "2"
35+
slog-async = { git = "https://github.com/Techcable/slog-async.git", branch = "feature/impl-simple-flush" }
3636

3737
[package.metadata.docs.rs]
3838
features = ["nested-values", "dynamic-keys"]

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ where
254254
}
255255
Ok(())
256256
}
257+
258+
fn flush(&self) -> Result<(), slog::FlushError> {
259+
let mut io = self.io.borrow_mut();
260+
io.flush().map_err(slog::FlushError::from)
261+
}
257262
}
258263

259264
// }}}

0 commit comments

Comments
 (0)