From 62ccc397535aa9369046c6e6af859d777a702084 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 10 Jan 2024 14:54:08 +0100 Subject: [PATCH] Reformat and tidy annotations --- pdns/logger.hh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/pdns/logger.hh b/pdns/logger.hh index 37216584dc..9a84661442 100644 --- a/pdns/logger.hh +++ b/pdns/logger.hh @@ -185,24 +185,30 @@ using OptLog = std::optional; void addTraceTS(const timeval& start, ostringstream& str); -#define VLOG(log, x) \ - if (log) { \ - if (std::holds_alternative>((log)->v)) { \ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define VLOG(log, x) \ + if (log) { \ + if (std::holds_alternative>((log)->v)) { \ + /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \ std::get>((log)->v).get() << Logger::Warning << (log)->prefix << x; \ - } \ - else if (std::holds_alternative>((log)->v)) { \ - addTraceTS((log)->start, std::get>((log)->v).get()); \ - std::get>((log)->v).get() << (log)->prefix << x; \ - } \ + } \ + else if (std::holds_alternative>((log)->v)) { \ + addTraceTS((log)->start, std::get>((log)->v).get()); \ + /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \ + std::get>((log)->v).get() << (log)->prefix << x; \ + } \ } -#define VLOG_NO_PREFIX(log, x) \ - if (log) { \ - if (std::holds_alternative>((log)->v)) { \ - std::get>((log)->v).get() << Logger::Warning << x; \ - } \ - else if (std::holds_alternative>((log)->v)) { \ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define VLOG_NO_PREFIX(log, x) \ + if (log) { \ + if (std::holds_alternative>((log)->v)) { \ + /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \ + std::get>((log)->v).get() << Logger::Warning << x; \ + } \ + else if (std::holds_alternative>((log)->v)) { \ addTraceTS((log)->start, std::get>((log)->v).get()); \ - std::get>((log)->v).get() << x; \ - } \ + /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \ + std::get>((log)->v).get() << x; \ + } \ } -- 2.47.2