aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/project-clang-format.py
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-23 15:03:30 +0200
committerEgor Tensin <egor@tensin.name>2026-06-23 15:03:30 +0200
commit079486ef964901bc768deece6edc24b5abfb6329 (patch)
treeda247e6efe98e6a83e14c9258f74e12f59d27c3b /tools/project-clang-format.py
parentshorter level names in log output (diff)
downloadcmake-common-6.1.2.tar.gz
cmake-common-6.1.2.zip
project-clang-format.py: prettier log outputv6.1.2
Diffstat (limited to 'tools/project-clang-format.py')
-rwxr-xr-xtools/project-clang-format.py14
1 files changed, 12 insertions, 2 deletions
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