From d5514d7f2795e7a353d54dc131e667d9126b8ff7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 31 Oct 2023 01:39:32 +0100 Subject: [PATCH] Added `utils.is_debug_enabled`. --- platypush/utils/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platypush/utils/__init__.py b/platypush/utils/__init__.py index b49b158f..69e9e5cc 100644 --- a/platypush/utils/__init__.py +++ b/platypush/utils/__init__.py @@ -764,4 +764,13 @@ def get_defining_class(meth) -> Optional[type]: return getattr(meth, '__objclass__', None) # handle special descriptor objects +def is_debug_enabled() -> bool: + """ + :return: True if the debug mode is enabled. + """ + from platypush.config import Config + + return (Config.get('logging') or {}).get('level') == logging.DEBUG + + # vim:sw=4:ts=4:et: