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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user