From 7c81c217c26c10226c313a9b78b6aa685de9ccef Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 15 Dec 2017 11:09:00 +0100 Subject: [PATCH] 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. --- src/basic/log.h | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.30.2