Set logging level by env var JUBILANT_LOG_LEVEL, default is DEBUG

This commit is contained in:
norohind 2021-11-02 02:37:52 +03:00
parent 648ade5f32
commit 67cec682a2
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

View File

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