Skip to content

Commit

Permalink
Set various loggers to suitable default levels
Browse files Browse the repository at this point in the history
These levels were pulled from bot's current logging setup
  • Loading branch information
ChrisLovering committed Sep 20, 2023
1 parent a87b852 commit 0357522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`
Expand Down
7 changes: 7 additions & 0 deletions pydis_core/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0357522

Please sign in to comment.