From 8f755c005b9152559b543c0e87be66cd858ab769 Mon Sep 17 00:00:00 2001 From: Thomas Krille Date: Wed, 5 Aug 2020 10:41:42 +0200 Subject: [PATCH] Fix condition for checking root logger handlers --- 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 24749d1..64fe729 100644 --- a/json_logging/__init__.py +++ b/json_logging/__init__.py @@ -81,7 +81,7 @@ def config_root_logger(): """ global _default_formatter - if len(logging.root.handlers) > 0: + if not logging.root.handlers: _logger.error( "No logging handlers found for root logger. Please made sure that you call this after you called " "logging.basicConfig() or logging.getLogger('root')")