From 6390b0fa1a8e67c51a571f367cd46d5d03180187 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 6 Sep 2022 00:07:46 +0100 Subject: [PATCH] move reading of os.environ out of a global which prohibits setting of os.environ at runtime --- src/openpower/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.30.2