Skip to content

Commit

Permalink
Removed double lock on older log functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopapereira committed May 6, 2014
1 parent 998f926 commit 199595f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/libJPLogger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> lock(*mutex);
char dateResult[20];
{
Expand Down
2 changes: 0 additions & 2 deletions src/libJPLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ Logger::getLogLvls(){

void Logger::log( std::string message , std::string module , int logsev, int type)
{
std::lock_guard<std::mutex> lock(mutex);
LogModules::iterator it;
LogType::iterator it1;

Expand All @@ -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<std::mutex> lock(mutex);
va_list args;
char outMsg[5000];
std::string toWrite;
Expand Down

0 comments on commit 199595f

Please sign in to comment.