summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2018-10-06 01:22:43 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2018-10-07 15:16:00 -0400
commit56432a44c64e6ab3b663fe783fd1b2138cee689d (patch)
treefa212e0adf4a4a28666f0a42879c08651e7202a0 /other
parentf5afc526550d935585f4023142853eeb95115734 (diff)
Make sure logger levels stay in sync across files
Diffstat (limited to 'other')
-rwxr-xr-xother/analysis/check_logger_levels18
1 files changed, 18 insertions, 0 deletions
diff --git a/other/analysis/check_logger_levels b/other/analysis/check_logger_levels
new file mode 100755
index 00000000..5cced4a1
--- /dev/null
+++ b/other/analysis/check_logger_levels
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3# Make sure that logger levels in toxcore/logger.h, CMakeLists.txt and
4# configure.ac stay in sync.
5
6set -ex
7
8TMP_DIR="$(mktemp -d)"
9
10# ^\s+LOGGER_LEVEL_(\w+),?$
11sed -n 's/^\s\+LOGGER_LEVEL_\(\w\+\),\?$/\1/p' toxcore/logger.h > "${TMP_DIR}/logger.h"
12# ^.*\$\{MIN_LOGGER_LEVEL\}" STREQUAL "(\w+)".*$
13sed -n 's/^.*\${MIN_LOGGER_LEVEL}\" STREQUAL \"\(\w\+\)\".*$/\1/p' CMakeLists.txt > "${TMP_DIR}/CMakeLists.txt"
14# ^.*LOGGER_LEVEL_(\w+).*$
15sed -n 's/^.*LOGGER_LEVEL_\(\w\+\).*$/\1/p' configure.ac > "${TMP_DIR}/configure.ac"
16
17diff -u "${TMP_DIR}/CMakeLists.txt" "${TMP_DIR}/logger.h"
18diff -u "${TMP_DIR}/configure.ac" "${TMP_DIR}/logger.h"