aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/utils/logging.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-03-05 16:30:34 +0000
committerGravatar GitHub <[email protected]>2022-03-05 16:30:34 +0000
commitf105af921d2e294e49388c4aff680912cf261ec6 (patch)
tree16948a48c841ed4e070092fb2804ac46acdad8f3 /botcore/utils/logging.py
parentMerge pull request #35 from python-discord/monkey-patch-in-util-namespace (diff)
parentfix: Set the logger class in botcore.utils.logging.py to the CustomLogger class (diff)
Merge pull request #37 from python-discord/fix/trace-loggingv3.0.1
Set the logger class in `logging.py` to `CustomLogger`
Diffstat (limited to 'botcore/utils/logging.py')
-rw-r--r--botcore/utils/logging.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/botcore/utils/logging.py b/botcore/utils/logging.py
index 71ce4e66..1f1c8bac 100644
--- a/botcore/utils/logging.py
+++ b/botcore/utils/logging.py
@@ -43,3 +43,9 @@ def get_logger(name: typing.Optional[str] = None) -> CustomLogger:
An instance of the :obj:`CustomLogger` class.
"""
return typing.cast(CustomLogger, logging.getLogger(name))
+
+
+# Setup trace level logging so that we can use it within botcore.
+logging.TRACE = TRACE_LEVEL
+logging.setLoggerClass(CustomLogger)
+logging.addLevelName(TRACE_LEVEL, "TRACE")