From 947f8eed33a2e066fa14a87987fd52e7e292d993 Mon Sep 17 00:00:00 2001 From: Oscar LAURENT <16085266+olaure@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:00:11 +0100 Subject: [PATCH] Remove root logger usage (#1617) The logging root logger was used in the utils which can cause noise when inspecting logs. Properly defining a logger and using it as is done everywhere increase consistency to the overall codebase. Co-authored-by: olaure --- rq/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rq/utils.py b/rq/utils.py index d556e697..6b5380fd 100644 --- a/rq/utils.py +++ b/rq/utils.py @@ -22,6 +22,7 @@ from redis.exceptions import ResponseError from .compat import as_text, is_python_version, string_types from .exceptions import TimeoutFormatError +logger = logging.getLogger(__name__) class _Colorizer: def __init__(self): @@ -141,7 +142,7 @@ def import_attribute(name): module = importlib.import_module(module_name) break except ImportError: - logging.warning("Import error for '%s'" % module_name, exc_info=True) + logger.warning("Import error for '%s'" % module_name, exc_info=True) attribute_bits.insert(0, module_name_bits.pop()) if module is None: