mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2803 Logging : Make calling of RiaLogging thread safe
This commit is contained in:
parent
a6b94f7e66
commit
89930e15f7
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user