Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fast-logger has a bug[^1] where flushing immediately after pushing a log message sometimes does not find anything to flush. Typically, users will flush the log because they intend to print non-logging output or as part of program exit. This bug causes output to be interleaved incorrectly in the former case and log messages to be lost entirely in the latter. To work around this, we delay 0.1s before flushing. There's no guarantee this works, and I don't know if the delay could be shorter or should be longer, but it has made things work reliably in my testing so far. [^1]: kazu-yamamoto/logger#213
- Loading branch information