Skip to content

Conversation

Esper89
Copy link
Contributor

@Esper89 Esper89 commented Sep 30, 2024

I fixed the possible undefined behavior in the logging system (static mut is evil) as well as the racy behavior when logging rapidly on multiple threads. I also improved logging performance by writing to a BufWriter instead of writing directly to the log file.

Logging rapidly on multiple threads will block some of the threads while another is logging; this could be fixed by logging to individual string buffers and putting them in a concurrent queue, but that's a lot of allocations and copying, so it's probably not worth it.

@konsti219 konsti219 merged commit 87145c9 into main Oct 3, 2024
2 checks passed
@konsti219 konsti219 deleted the logging branch October 3, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants