From 4920515c5a8e43ef9ca444254d1276058fcfa971 Mon Sep 17 00:00:00 2001 From: ToxicKidz Date: Fri, 4 Mar 2022 22:28:57 -0500 Subject: fix: Set the logger class in botcore.utils.logging.py to the CustomLogger class Fixes an issue when using trace logging on loggers that were instantiated before the class was set. --- botcore/utils/logging.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'botcore/utils') 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") -- cgit v1.2.3