From 8d755517a21ddea9aba08fe2e91540c3dd72d992 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 27 Jan 2015 14:01:10 +0100 Subject: [PATCH] fix up jumbled to console logging --- pdns/logger.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/logger.cc b/pdns/logger.cc index 186f2ad54..e9d46749d 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 <