allow color formatter via env variable OMNIPERF_COLOR=1
Signed-off-by: Karl W Schulz <karl.schulz@amd.com>
This commit is contained in:
committad av
Karl W. Schulz
förälder
b27a2b2c10
incheckning
34070394eb
+7
-1
@@ -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")
|
||||
|
||||
Referens i nytt ärende
Block a user