From 03575223498fa16ecec18ef3965893fa8bf716a7 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 19 Sep 2023 16:07:32 +0100 Subject: [PATCH] Set various loggers to suitable default levels These levels were pulled from bot's current logging setup --- docs/changelog.rst | 1 + pydis_core/utils/logging.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index bc3963661..addb5a36f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,7 @@ Changelog - :release:`10.3.0 <19th September 2023>` - :feature:`195` Add `log_format` to `pydis_core.utils.logging` to allow for standardised logging across all services using pydis_core. +- :feature:`195` Set `discord`, `websockets`, `chardet` & `async_rediscache` loggers to warning level and `asyncio` to info level by default. - :release:`10.2.0 <28th August 2023>` diff --git a/pydis_core/utils/logging.py b/pydis_core/utils/logging.py index c8eb5b199..256151a8b 100644 --- a/pydis_core/utils/logging.py +++ b/pydis_core/utils/logging.py @@ -55,3 +55,10 @@ def get_logger(name: str | None = None) -> CustomLogger: logging.TRACE = TRACE_LEVEL logging.setLoggerClass(CustomLogger) logging.addLevelName(TRACE_LEVEL, "TRACE") + +get_logger("discord").setLevel(logging.WARNING) +get_logger("websockets").setLevel(logging.WARNING) +get_logger("chardet").setLevel(logging.WARNING) +get_logger("async_rediscache").setLevel(logging.WARNING) +# Set back to the default of INFO even if asyncio's debug mode is enabled. +get_logger("asyncio").setLevel(logging.INFO)