Closed aidanmelen closed 2 years ago
perhaps _assert_messages_sent shouldn't only exist for testing purposes
That's a great observation! Thanks for your valuable input. Let me think about it, and I'll update you here soon
See this:
https://stackoverflow.com/questions/70733909/can-i-run-cleanup-code-in-daemon-threads-in-python
In the meantime, since I suspect there is no good solution to my question, I guess I'll have to expose a way for you (the user) to wait for messages to send before exiting.
btw, feel free to join my discord server. you can ask questions/make suggestions about this project over there https://discord.com/invite/mzhSRnnY78
There was a quite elegant solution posted to the SO link above, I'll be implementing it for v1.0.5 soon, and thus will be deprecating the flush method.
I have noticed some interesting behavior. if the program exits normally then the last last few log events are not sent to Discord. However, you if place a
time.sleep(10)
at the end, there is a better chance the logs are flushed and sent to Discord.