From: Miod Vallat Date: Fri, 20 Feb 2026 09:22:43 +0000 (+0100) Subject: Give IterLoggable the same type flexibility as Loggable. X-Git-Tag: dnsdist-2.1.0-beta1~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e740c88e2f19faf0f4cbfea936aabc1c20fdb2c;p=thirdparty%2Fpdns.git Give IterLoggable the same type flexibility as Loggable. Signed-off-by: Miod Vallat --- diff --git a/pdns/logging.hh b/pdns/logging.hh index bb874dafce..7902d3a6d0 100644 --- a/pdns/logging.hh +++ b/pdns/logging.hh @@ -154,7 +154,24 @@ struct IterLoggable : public Logr::Loggable else { first = false; } - oss << *i; + if constexpr (std::is_same_v) { + oss << *i; + } + else if constexpr (is_toStructuredLogString_available::value) { + oss << i->toStructuredLogString(); + } + else if constexpr (is_toLogString_available::value) { + oss << i->toLogString(); + } + else if constexpr (is_toString_available::value) { + oss << i->toString(); + } + else if constexpr (is_to_string_available::value) { + oss << std::to_string(*i); + } + else { + oss << *i; + } } return oss.str(); }