Add dynamic log level #1

Merged
Kim merged 6 commits from python3.10 into master 2022-08-13 12:30:22 +02:00
Showing only changes of commit ed35590ac6 - Show all commits

View File

@ -6,6 +6,8 @@ import colorlog
def loghandler():
_logger = colorlog.getLogger(__name__)
loglevel = os.getenv('LOG_LEVEL', "INFO")
match loglevel.lower():
@ -22,8 +24,6 @@ def loghandler():
case _:
raise ValueError("Definied value of LOG_LEVEL is not known. Possible values are debug, info, warn, warning, error, crit and critical.")
_logger = colorlog.getLogger(__name__)
handler = colorlog.StreamHandler(sys.stdout)
if loglevel:
handler.setLevel(logging.DEBUG)