Skip to content

Commit

Permalink
Merge pull request #82 from mrkline/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Sep 27, 2021
2 parents ce44265 + 523355a commit aea22db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "simplelog"
version = "0.10.1"
version = "0.10.2"
edition = "2018"
authors = ["Drakulix <github@drakulix.de>"]
description = "A simple and easy-to-use logging facility for Rust's log crate"
Expand Down
9 changes: 8 additions & 1 deletion src/loggers/termlog.rs
Expand Up @@ -159,7 +159,14 @@ impl TermLogger {
write_location(record, term_lock)?;
}

write_args(record, term_lock)
write_args(record, term_lock)?;

// The log crate holds the logger as a `static mut`, which isn't dropped
// at program exit: https://doc.rust-lang.org/reference/items/static-items.html
// Sadly, this means we can't rely on the BufferedStandardStreams flushing
// themselves on the way out, so to avoid the Case of the Missing 8k,
// flush each entry.
term_lock.flush()
}

fn try_log(&self, record: &Record<'_>) -> Result<(), Error> {
Expand Down

0 comments on commit aea22db

Please sign in to comment.