From: Otto Moerbeek Date: Tue, 17 Jan 2023 14:10:58 +0000 (+0100) Subject: Reformat X-Git-Tag: dnsdist-1.8.0-rc1~83^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fdd2484c550b976b912cf38546d41189d8b1964;p=thirdparty%2Fpdns.git Reformat --- diff --git a/pdns/logger.hh b/pdns/logger.hh index 88e45eb6f7..2f24bdf9cd 100644 --- a/pdns/logger.hh +++ b/pdns/logger.hh @@ -171,7 +171,8 @@ Logger& getLogger(); // (trace-regexp). We feed an OptLog object to the code that should not know anything about this // That code shold then log using VLOG -struct LogVariant { +struct LogVariant +{ string prefix; // variant cannot hold references std::variant v; @@ -183,14 +184,13 @@ using OptLog = std::optional; // Originally there was a flag but is was never set from !RECURSOR #define VLOG(log, x) #error VLOG only works in recursor #else -#define VLOG(log, x) \ - if (log) { \ - if (std::holds_alternative((log)->v)) { \ +#define VLOG(log, x) \ + if (log) { \ + if (std::holds_alternative((log)->v)) { \ *std::get(log->v) << Logger::Warning << (log)->prefix << x; \ - } \ - else if (std::holds_alternative((log)->v)) { \ - *std::get((log)->v) << (log)->prefix << x; \ - } \ + } \ + else if (std::holds_alternative((log)->v)) { \ + *std::get((log)->v) << (log)->prefix << x; \ + } \ } #endif - diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index 8f4b7b7390..0e0b95e5d5 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -469,12 +469,12 @@ bool SyncRes::s_save_parent_ns_set; unsigned int SyncRes::s_max_busy_dot_probes; bool SyncRes::s_addExtendedResolutionDNSErrors; -#define LOG(x) \ - if (d_lm == Log) { \ - g_log << Logger::Warning << x; \ - } \ - else if (d_lm == Store) { \ - d_trace << x; \ +#define LOG(x) \ + if (d_lm == Log) { \ + g_log << Logger::Warning << x; \ + } \ + else if (d_lm == Store) { \ + d_trace << x; \ } OptLog SyncRes::LogObject(const string& prefix) @@ -483,7 +483,7 @@ OptLog SyncRes::LogObject(const string& prefix) if (d_lm == Log) { ret = {prefix, &g_log}; } - else if(d_lm == Store) { + else if (d_lm == Store) { ret = {prefix, &d_trace}; } return ret;