From a014b3e4779872a94cc7a4dc3cf98631ab96c8f5 Mon Sep 17 00:00:00 2001 From: Brydon Cheyney Date: Fri, 31 May 2024 15:33:49 +0100 Subject: [PATCH] fix: wrap debug log when logger upated to using JSONLogFormatter --- json_logging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json_logging/__init__.py b/json_logging/__init__.py index 94ee039..2990560 100644 --- a/json_logging/__init__.py +++ b/json_logging/__init__.py @@ -127,7 +127,7 @@ def __init(framework_name=None, custom_formatter=None, enable_json=False): if ENABLE_JSON_LOGGING: logging._defaultFormatter = _default_formatter() - _logger.debug("Update all existing logger to using JSONLogFormatter") + ENABLE_JSON_LOGGING and _logger.debug("Update all existing logger to using JSONLogFormatter") existing_loggers = list(map(logging.getLogger, logging.Logger.manager.loggerDict)) util.update_formatter_for_loggers(existing_loggers, _default_formatter)