From: Luke Kenneth Casson Leighton Date: Mon, 5 Sep 2022 23:07:46 +0000 (+0100) Subject: move reading of os.environ out of a global which prohibits X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6390b0fa1a8e67c51a571f367cd46d5d03180187;p=openpower-isa.git move reading of os.environ out of a global which prohibits setting of os.environ at runtime --- diff --git a/src/openpower/util.py b/src/openpower/util.py index 7c0a29bf..71952de5 100644 --- a/src/openpower/util.py +++ b/src/openpower/util.py @@ -131,7 +131,6 @@ def parse_log_env_vars(): return retval -LOG_KINDS_SILENCED = parse_log_env_vars() def log(*args, kind=LogKind.Default, **kwargs): @@ -139,6 +138,9 @@ def log(*args, kind=LogKind.Default, **kwargs): """ # look up in a dict rather than os.environ so we don't # trigger breakpoints on raising exceptions. + # read os.environ so that modifications to os.environ at runtime + # are picked up + LOG_KINDS_SILENCED = parse_log_env_vars() if LOG_KINDS_SILENCED[kind]: return print(*args, **kwargs)