You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#689.
Normally the `BufWriter` in `LogBackend` is `flush`ed in `drop`, but since all of this runs from a static or a background thread, no destructors are run (reliably at least; not sure about the background thread case). Thus, we need to explicitly `flush` the buffer. I believe this may be the remaining cause of #613.
This fix adds a `flush` method to `trait WriteEvent`, which is called after all `Event`s have been written so that we never lose any of the `Event`s. It's implemented by delegating to `Write::flush`, both for `BufWriter` in `LogBackend` and `stderr()` in `DebugBackend` (though that one is usually unbuffered).
I discovered this while implementing #687, as the missing `flush` is reliably detected when running the `Backend` on the main thread.
0 commit comments