summaryrefslogtreecommitdiffstats
path: root/test/log.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-05-31 16:08:53 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2022-02-17 18:02:35 +0000
commitb23ffd7ef216463c35b75c831e6a27e58971f4ec (patch)
tree84983bd698b2b3da6c6278e870ef978f69dbda43 /test/log.py
parent8ccc6b350703d3390633636d2b1c2f578f37cb21 (diff)
tests: make tests less make dependent
Implement command line argument parsing instead of passing arguments via environment variables. Add script for running tests without having to invoke make. Deprecate running tests via make. Type: improvement Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e Signed-off-by: Klement Sekera <ksekera@cisco.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'test/log.py')
-rw-r--r--test/log.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/log.py b/test/log.py
index 5fd91c794e8..9701aecc04a 100644
--- a/test/log.py
+++ b/test/log.py
@@ -4,6 +4,8 @@ import sys
import os
import logging
+from config import config
+
""" @var formatting delimiter consisting of '=' characters """
double_line_delim = '=' * 78
""" @var formatting delimiter consisting of '-' characters """
@@ -24,15 +26,12 @@ class ColorFormatter(logging.Formatter):
if hasattr(record, 'color'):
message = colorize(message, record.color)
return message
-try:
- verbose = int(os.getenv("V", 0))
-except:
- verbose = 0
+
# 40 = ERROR, 30 = WARNING, 20 = INFO, 10 = DEBUG, 0 = NOTSET (all messages)
-if verbose >= 2:
+if config.verbose >= 2:
log_level = 10
-elif verbose == 1:
+elif config.verbose == 1:
log_level = 20
else:
log_level = 40
@@ -66,6 +65,7 @@ def get_parallel_logger(stream):
logger.addHandler(handler)
return logger
+
# Static variables to store color formatting strings.
#
# These variables (RED, GREEN, YELLOW and LPURPLE) are used to configure