ref T104, unify logging of inconsistent data

This commit is contained in:
Klaus Basan
2017-07-12 18:55:29 +02:00
committed by Mathew Sutcliffe
parent f53a64396a
commit c55ad7e142
2 changed files with 19 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include "blackmisc/network/networkutils.h"
#include "blackmisc/threadutils.h"
#include "blackmisc/logmessage.h"
#include "blackmisc/verify.h"
#include <QCoreApplication>
#include <QMetaObject>
@@ -149,4 +150,18 @@ namespace BlackCore
if (!isEnabled()) { return false; }
return true;
}
void CThreadedReader::logInconsistentData(const CStatusMessage &msg, const char *funcInfo)
{
if (msg.isEmpty()) { return; }
CStatusMessage logMsg(msg);
logMsg.addCategory(CLogCategory::dataInconsistency());
logMsg.setSeverity(CStatusMessage::SeverityWarning);
if (funcInfo)
{
const QByteArray m(logMsg.getMessage().toLatin1());
BLACK_AUDIT_X(false, funcInfo, m.constData());
}
CLogMessage::preformatted(logMsg);
}
} // namespace