Added `utils.is_debug_enabled`.

This commit is contained in:
Fabio Manganiello 2023-10-31 01:39:32 +01:00
parent ef3b1d20f2
commit d5514d7f27
1 changed files with 9 additions and 0 deletions

View File

@ -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: