From: Remi Gacogne Date: Tue, 12 Apr 2022 13:41:48 +0000 (+0200) Subject: dnsdist: Reuse the temporary logging string for syslog X-Git-Tag: auth-4.8.0-alpha0~142^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11531%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Reuse the temporary logging string for syslog --- diff --git a/pdns/dolog.hh b/pdns/dolog.hh index 3c5237a5bd..638db32aa9 100644 --- a/pdns/dolog.hh +++ b/pdns/dolog.hh @@ -93,8 +93,11 @@ void genlog(int level, const char* s, Args... args) std::ostringstream str; dolog(str, s, args...); - if(g_syslog) - syslog(level, "%s", str.str().c_str()); + auto output = str.str(); + + if (g_syslog) { + syslog(level, "%s", output.c_str()); + } #ifdef DNSDIST if (g_logtimestamps) { @@ -110,7 +113,7 @@ void genlog(int level, const char* s, Args... args) } #endif - std::cout<