Skip to content

Commit 1a6d6b5

Browse files
committed
Set various loggers to suitable default levels
These levels were pulled from bot's current logging setup
1 parent 0f173e7 commit 1a6d6b5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77

88
- :release:`10.3.0 <19th September 2023>`
99
- :feature:`193` Add both `LOGGING_FORMAT_STRING` and `log_format` to `pydis_core.utils.logging` to allow for standardised logging out for all services using pydis_core.
10+
- :feature:`193` Set `discord`, `websockets`, `chardet` & `async_rediscache` loggers to warning level and `asyncio` to info level by default.
1011

1112

1213
- :release:`10.2.0 <28th August 2023>`

pydis_core/utils/logging.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ def get_logger(name: str | None = None) -> CustomLogger:
5151
logging.TRACE = TRACE_LEVEL
5252
logging.setLoggerClass(CustomLogger)
5353
logging.addLevelName(TRACE_LEVEL, "TRACE")
54+
55+
get_logger("discord").setLevel(logging.WARNING)
56+
get_logger("websockets").setLevel(logging.WARNING)
57+
get_logger("chardet").setLevel(logging.WARNING)
58+
get_logger("async_rediscache").setLevel(logging.WARNING)
59+
# Set back to the default of INFO even if asyncio's debug mode is enabled.
60+
get_logger("asyncio").setLevel(logging.INFO)

0 commit comments

Comments
 (0)