summaryrefslogtreecommitdiffstatshomepage
path: root/test/stress
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-23 15:00:00 +0200
committerEgor Tensin <egor@tensin.name>2026-06-23 15:18:35 +0200
commit62b26afaab89f4e38606a80f3a42d679d4170bec (patch)
tree79a681e3cc2265dd8f997735b17fdbf9791b2f5a /test/stress
parenttest/stress: prettier log output (diff)
downloadmath-server-62b26afaab89f4e38606a80f3a42d679d4170bec.tar.gz
math-server-62b26afaab89f4e38606a80f3a42d679d4170bec.zip
test/stress: short level names in log output
Diffstat (limited to 'test/stress')
-rwxr-xr-xtest/stress/test.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/stress/test.py b/test/stress/test.py
index 4f40b15..407b13a 100755
--- a/test/stress/test.py
+++ b/test/stress/test.py
@@ -257,11 +257,20 @@ def _parse_args(argv=None):
@contextmanager
def _setup_logging():
+ level_names = {
+ logging.DEBUG: "DBG",
+ logging.INFO: "INFO",
+ logging.WARNING: "WARN",
+ logging.ERROR: "ERR",
+ logging.CRITICAL: "CRIT",
+ }
+ for lvl, name in level_names.items():
+ logging.addLevelName(lvl, name)
+
logging.basicConfig(
level=logging.DEBUG,
datefmt="%Y-%m-%d %H:%M:%S%z",
- # The 8 below is for "CRITICAL"
- format="%(asctime)s | %(levelname)8s | %(message)s",
+ format="%(asctime)s | %(levelname)4s | %(message)s",
)
try:
yield