whitespace
[openpower-isa.git] / src / openpower / util.py
index 059dc253a8ee4691f4b712c47d45b88cc9b8b91b..71952de5e9229a21e6889a8ed65b307c5a7d0232 100644 (file)
@@ -126,12 +126,11 @@ def parse_log_env_vars():
                 retval[k] = silenced
         assert matches, (f"SILENCELOG: {v!r} did not match any known LogKind: "
                          f"LogKinds: {' '.join(i.value for i in LogKind)}")
-    for k, v in retval.items():
-        print(repr(k), "silenced" if v else "active")
+    for k, v in retval.items():
+    #    print(repr(k), "silenced" if v else "active")
     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)