From 079486ef964901bc768deece6edc24b5abfb6329 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 23 Jun 2026 15:03:30 +0200 Subject: project-clang-format.py: prettier log output --- tools/project-clang-format.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tools/project-clang-format.py') diff --git a/tools/project-clang-format.py b/tools/project-clang-format.py index a626a63..148e04c 100755 --- a/tools/project-clang-format.py +++ b/tools/project-clang-format.py @@ -23,10 +23,20 @@ import sys @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( - format='%(asctime)s | %(levelname)s | %(message)s', - datefmt='%Y-%m-%d %H:%M:%S%z', level=logging.INFO, + datefmt='%Y-%m-%d %H:%M:%S%z', + format='%(asctime)s | %(levelname)4s | %(message)s', ) try: yield -- cgit v1.3