Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
appender: explicitly flush previous BufWriter before dropping (#1604)
## Motivation When a `RollingFileAppender` is refreshed, the previous `BufWriter` may encounter and suppress errors in `drop`. From https://doc.rust-lang.org/std/io/struct.BufWriter.html: > It is critical to call flush before BufWriter<W> is dropped. Though > dropping will attempt to flush the contents of the buffer, any errors > that happen in the process of dropping will be ignored. ## Solution Explicitly flush the previous buffer before dropping, printing any error to stderr.
- Loading branch information