From: Lennart Poettering Date: Fri, 15 Dec 2017 10:09:00 +0000 (+0100) Subject: tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7c81c217c26c10226c313a9b78b6aa685de9ccef;p=elogind.git tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645) 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. --- diff --git a/src/basic/log.h b/src/basic/log.h index 78b097f0f..297bb92b9 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -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)