allow color formatter via env variable OMNIPERF_COLOR=1

Signed-off-by: Karl W Schulz <karl.schulz@amd.com>


[ROCm/rocprofiler-compute commit: 34070394eb]
Este commit está contenido en:
Karl W Schulz
2024-03-08 17:42:22 -06:00
cometido por Karl W. Schulz
padre fbf3711eb2
commit 35a983b85a
@@ -54,7 +54,13 @@ class ColoredFormatter(logging.Formatter):
# Setup console handler - provided as separate function to be called
# prior to argument parsing
def setup_console_handler():
if False:
color = False
if "OMNIPERF_COLOR" in os.environ.keys():
if os.environ["OMNIPERF_COLOR"] == "1":
color = True
if color:
formatter = ColoredFormatter("%(levelname)s %(message)s")
else:
formatter = logging.Formatter("%(message)s")