]> granicus.if.org Git - pdns/commitdiff
fix up jumbled to console logging
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 27 Jan 2015 13:01:10 +0000 (14:01 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 27 Jan 2015 13:01:10 +0000 (14:01 +0100)
pdns/logger.cc

index 186f2ad54d302d95862d78a759b7e4df2770a2c3..e9d46749d81717c1d241d0e013629288b80bae9b 100644 (file)
@@ -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 <<endl;
   }
   if( u <= d_loglevel ) {