matobodo / DiscordWebhookLogging

Simple Discord webhook logger
MIT License
8 stars 0 forks source link

Logging does not work unless auto flush is set to true #3

Closed 3ear closed 9 months ago

3ear commented 9 months ago

title

matobodo commented 9 months ago

hello, thank you for reporting issues, I will look into it tonight

matobodo commented 9 months ago

I have tested this and it is working as it should.

Here in readme is explained how the buffering works. https://github.com/matobodo/DiscordWebhookLogging?tab=readme-ov-file#flushing-buffered-messages

If you need further assistance, I'm happy to help. If you still have issues, please provide me with your environment setup, OS, Python version, etc.

3ear commented 9 months ago

finally got a chance to look further into the implementation. The intention is to store messages until the buffer is full and then send it all? That seems like poor functionality for a logger. I expected a timer that would be used to bunch messages for sending them for rate limits as opposed to just raw char counts

matobodo commented 9 months ago

This functionality was good enough for me when using it in my project. The buffer was implemented to group more log messages into single discord message to prevent hitting the discord api rate limiting.

The timer is a great suggestion. As already stated in another issue, the handler needs to be reworked so it works asynchronously to prevent locking threads that call logging methods and with this change I can also add timer that will send the buffered messages eg. every 5 seconds.

3ear commented 9 months ago

That would be great, especially if it is configurable at init.

matobodo commented 9 months ago

I've just now created an issue for this, #5.