From 199595f340042a1764fbdf511aab4a8cc1a3c5d8 Mon Sep 17 00:00:00 2001 From: joaopapereira Date: Tue, 6 May 2014 18:14:28 +0200 Subject: [PATCH] Removed double lock on older log functions --- include/libJPLogger.hpp | 4 +++- src/libJPLogger.cpp | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libJPLogger.hpp b/include/libJPLogger.hpp index 125eacc..25cd4c1 100755 --- a/include/libJPLogger.hpp +++ b/include/libJPLogger.hpp @@ -332,8 +332,10 @@ class LoggerTemporaryStream: public std::ostream */ virtual int sync ( ) { - if(0 == module.compare("-1")) + if(0 == module.compare("-1")){ + str(""); return 0; + } std::lock_guard lock(*mutex); char dateResult[20]; { diff --git a/src/libJPLogger.cpp b/src/libJPLogger.cpp index 6e96459..3bf5fcb 100755 --- a/src/libJPLogger.cpp +++ b/src/libJPLogger.cpp @@ -170,7 +170,6 @@ Logger::getLogLvls(){ void Logger::log( std::string message , std::string module , int logsev, int type) { - std::lock_guard lock(mutex); LogModules::iterator it; LogType::iterator it1; @@ -183,7 +182,6 @@ void Logger::log( std::string message , std::string module , int logsev, int typ } void Logger::log( std::string module , int logsev, int type, std::string message ,...) { - std::lock_guard lock(mutex); va_list args; char outMsg[5000]; std::string toWrite;