summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-09-19 16:07:32 +0100
committerGravatar Chris Lovering <[email protected]>2023-09-20 17:34:25 +0100
commit03575223498fa16ecec18ef3965893fa8bf716a7 (patch)
treea16ee22664bb379f5c7fda63211cfc9b26e17e4a
parent Add log_format to the logging util to allow for standardised logging (diff)
Set various loggers to suitable default levelsv10.3.0
These levels were pulled from bot's current logging setup
-rw-r--r--docs/changelog.rst1
-rw-r--r--pydis_core/utils/logging.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index bc396366..addb5a36 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 c8eb5b19..256151a8 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)