mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
ref T104, unify logging of inconsistent data
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f53a64396a
commit
c55ad7e142
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user