diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-23 15:03:30 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-23 15:03:30 +0200 |
| commit | 079486ef964901bc768deece6edc24b5abfb6329 (patch) | |
| tree | da247e6efe98e6a83e14c9258f74e12f59d27c3b /tools | |
| parent | shorter level names in log output (diff) | |
| download | cmake-common-079486ef964901bc768deece6edc24b5abfb6329.tar.gz cmake-common-079486ef964901bc768deece6edc24b5abfb6329.zip | |
project-clang-format.py: prettier log outputv6.1.2
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/project-clang-format.py | 14 |
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 |
