From 435d56e7c50e030f0a84705a023a27a29354047b Mon Sep 17 00:00:00 2001 From: Alex Kremer Date: Wed, 16 Aug 2023 22:57:52 +0100 Subject: [PATCH] Fix empty log lines (#825) --- src/util/log/Logger.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/log/Logger.h b/src/util/log/Logger.h index dcb4d296..84f79262 100644 --- a/src/util/log/Logger.h +++ b/src/util/log/Logger.h @@ -90,13 +90,15 @@ using SourceLocationType = SourceLocation; /** * @brief Skips evaluation of expensive argument lists if the given logger is disabled for the required severity level. + * + * Note: Currently this introduces potential shadowing (unlikely). */ -#define LOG(x) \ - if (!x) \ - { \ - } \ - else \ - x +#define LOG(x) \ + if (auto clio_pump__ = x; not clio_pump__) \ + { \ + } \ + else \ + clio_pump__ /** * @brief Custom severity levels for @ref util::Logger.