diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-23 15:00:00 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-23 15:18:35 +0200 |
| commit | 62b26afaab89f4e38606a80f3a42d679d4170bec (patch) | |
| tree | 79a681e3cc2265dd8f997735b17fdbf9791b2f5a /test | |
| parent | test/stress: prettier log output (diff) | |
| download | math-server-62b26afaab89f4e38606a80f3a42d679d4170bec.tar.gz math-server-62b26afaab89f4e38606a80f3a42d679d4170bec.zip | |
test/stress: short level names in log output
Diffstat (limited to 'test')
| -rwxr-xr-x | test/stress/test.py | 13 |
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 |
