Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
423 stars 71 forks source link

TermLogger: Flush each entry #82

Closed mrkline closed 2 years ago

mrkline commented 2 years ago

The log crate holds the logger as a static mut reference 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.

Fixes #80

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.06%) to 68.958% when pulling 523355a2d12b0a9c052f4d9ce2e8a26ad00cf719 on mrkline:master into ce44265b4bf88a06d551cf018270a85b71725aba on Drakulix:master.

Drakulix commented 2 years ago

Thanks for the quick fix!