#2803 Logging : Make calling of RiaLogging thread safe

This commit is contained in:
Magne Sjaastad 2018-05-04 07:36:51 +02:00
parent a6b94f7e66
commit 89930e15f7

View File

@ -192,7 +192,6 @@ void RiaLogging::setLoggerInstance(RiaLogger* loggerInstance)
delete sm_logger;
}
// VF_ASSERT(loggerInstance);
sm_logger = loggerInstance;
}
@ -213,6 +212,7 @@ void RiaLogging::error(const QString& message)
{
if (sm_logger && sm_logger->level() >= RI_LL_ERROR)
{
#pragma omp critical
sm_logger->error(message.toLatin1().constData());
}
}
@ -224,6 +224,7 @@ void RiaLogging::warning(const QString& message)
{
if (sm_logger && sm_logger->level() >= RI_LL_WARNING)
{
#pragma omp critical
sm_logger->warning(message.toLatin1().constData());
}
}
@ -235,6 +236,7 @@ void RiaLogging::info(const QString& message)
{
if (sm_logger && sm_logger->level() >= RI_LL_INFO)
{
#pragma omp critical
sm_logger->info(message.toLatin1().constData());
}
}
@ -246,6 +248,7 @@ void RiaLogging::debug(const QString& message)
{
if (sm_logger && sm_logger->level() >= RI_LL_DEBUG)
{
#pragma omp critical
sm_logger->debug(message.toLatin1().constData());
}
}