Commit 024d6ab
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.1 parent f350c08 commit 024d6ab
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
0 commit comments