chiark / gitweb /
tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645)
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Dec 2017 10:09:00 +0000 (11:09 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:49:37 +0000 (07:49 +0200)
This makes things a bit easier to read I think, and also makes sure we
always use the _unlikely_ wrapper around it, which so far we used
sometimes and other times we didn't. Let's clean that up.

src/basic/log.h

index 78b097f0fce257dcb77b71ceef48fd261d073279..297bb92b99c03567930adf4a33b54368e540f0ea 100644 (file)
@@ -344,3 +344,5 @@ int log_syntax_internal(
                                             "String is not UTF-8 clean, ignoring assignment: %s", strna(_p)); \
                 }                                                       \
         })
+
+#define DEBUG_LOGGING _unlikely_(log_get_max_level() >= LOG_DEBUG)