From: bert hubert Date: Tue, 27 Jan 2015 13:01:10 +0000 (+0100) Subject: fix up jumbled to console logging X-Git-Tag: rec-3.7.0-rc2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d755517a21ddea9aba08fe2e91540c3dd72d992;p=thirdparty%2Fpdns.git fix up jumbled to console logging --- diff --git a/pdns/logger.cc b/pdns/logger.cc index 186f2ad54d..e9d46749d8 100644 --- a/pdns/logger.cc +++ b/pdns/logger.cc @@ -47,9 +47,11 @@ void Logger::log(const string &msg, Urgency u) time(&t); tm=*localtime(&t); - if(u<=consoleUrgency) {// Sep 14 06:52:09 + if(u<=consoleUrgency) { char buffer[50]; strftime(buffer,sizeof(buffer),"%b %d %H:%M:%S ", &tm); + static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; + Lock l(&m); // the C++-2011 spec says we need this, and OSX actually does clog << string(buffer) + msg <