Add rate limit logging and enhance Discord bot initialization

- Introduced a new module `rate_limit_logging.py` to log HTTP headers for Discord API rate limits (HTTP 429).
- Updated the Discord bot initialization in `__init__.py` to include a custom HTTP trace configuration for better rate limit handling.
- Adjusted logging levels in `run-web.py` to reduce verbosity for rate limit headers.
This commit is contained in:
2026-03-25 23:10:02 +01:00
parent 3c7d7f4e80
commit b51430e2b2
3 changed files with 71 additions and 1 deletions
+2
View File
@@ -55,6 +55,8 @@ if __name__ == '__main__':
# Calmer les logs verbeux de certaines libs si besoin
logging.getLogger('werkzeug').setLevel(logging.WARNING)
logging.getLogger('discord').setLevel(logging.WARNING)
# 429 : en-têtes X-RateLimit-* (voir discordbot/rate_limit_logging.py + doc Discord rate limits)
logging.getLogger('discord.ratelimit_headers').setLevel(logging.WARNING)
# Hook exceptions non-capturées (threads inclus)
def _log_uncaught(exc_type, exc, tb):