From 67cec682a22c59fa80137744fcd2210043745cf8 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Tue, 2 Nov 2021 02:37:52 +0300 Subject: [PATCH] Set logging level by env var JUBILANT_LOG_LEVEL, default is DEBUG --- EDMCLogging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EDMCLogging.py b/EDMCLogging.py index 77030bb..6dfd169 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -38,6 +38,7 @@ To utilise logging in a 'found' (third-party) plugin, include this: import inspect import logging import logging.handlers +import os from contextlib import suppress from fnmatch import fnmatch # So that any warning about accessing a protected member is only in one place. @@ -439,7 +440,7 @@ def get_main_logger(sublogger_name: str = '') -> 'LoggerMixin': # Singleton -loglevel = logging.DEBUG +loglevel = logging._nameToLevel.get(os.getenv('JUBILANT_LOG_LEVEL').upper(), logging.DEBUG) # noqa: base_logger_name = __name__