mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T104, use unified log function
and removed some redundant log messages
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c55ad7e142
commit
874b517e23
@@ -12,7 +12,6 @@
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/verify.h"
|
||||
#include <QNetworkReply>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -175,8 +174,9 @@ namespace BlackCore
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
{
|
||||
BLACK_AUDIT_X(false, Q_FUNC_INFO, "Inconsistent aircraft codes");
|
||||
CLogMessage(this).warning("Inconsistent airports: %1") << inconsistent.dbKeysAsStrings(", ");
|
||||
logInconsistentData(
|
||||
CStatusMessage(this, CStatusMessage::SeverityInfo, "Inconsistent airports: " + inconsistent.dbKeysAsStrings(", ")),
|
||||
Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
const int size = airports.size();
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "blackmisc/json.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/verify.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
@@ -257,8 +256,9 @@ namespace BlackCore
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
{
|
||||
BLACK_AUDIT_X(false, Q_FUNC_INFO, "Inconsistent aircraft codes");
|
||||
CLogMessage(this).warning("Inconsistent aircraft codes: %1") << inconsistent.dbKeysAsStrings(", ");
|
||||
logInconsistentData(
|
||||
CStatusMessage(this, CStatusMessage::SeverityInfo, "Inconsistent aircraft codes: " + inconsistent.dbKeysAsStrings(", ")),
|
||||
Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
const int n = codes.size();
|
||||
@@ -301,13 +301,14 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// normally read from special view which already filters incomplete
|
||||
codes = CAirlineIcaoCodeList::fromDatabaseJson(res, true, &inconsistent);
|
||||
codes = CAirlineIcaoCodeList::fromDatabaseJson(res, true, &inconsistent);
|
||||
}
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
{
|
||||
BLACK_AUDIT_X(false, Q_FUNC_INFO, "Inconsistent airline codes");
|
||||
CLogMessage(this).warning("Inconsistent airline codes: %1") << inconsistent.dbKeysAsStrings(", ");
|
||||
logInconsistentData(
|
||||
CStatusMessage(this, CStatusMessage::SeverityInfo, "Inconsistent airline codes: " + inconsistent.dbKeysAsStrings(", ")),
|
||||
Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
const int n = codes.size();
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace BlackCore
|
||||
// Worker thread, make sure to write no members here od do it threadsafe
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated booking parsing process");
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
@@ -128,7 +127,6 @@ namespace BlackCore
|
||||
{
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated booking parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -205,7 +205,6 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated VATSIM file parsing process");
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
@@ -242,7 +241,6 @@ namespace BlackCore
|
||||
{
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated VATSIM file parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
@@ -414,7 +412,9 @@ namespace BlackCore
|
||||
// warnings, if required
|
||||
if (!illegalIcaoCodes.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info("Illegal / ignored ICAO code(s) in VATSIM data file: %1") << illegalIcaoCodes.join(", ");
|
||||
logInconsistentData(
|
||||
CStatusMessage(this, CStatusMessage::SeverityInfo, "Illegal / ignored ICAO code(s) in VATSIM data file: " + illegalIcaoCodes.join(", "))
|
||||
);
|
||||
}
|
||||
|
||||
// data read finished
|
||||
@@ -446,7 +446,9 @@ namespace BlackCore
|
||||
if (currentLine.endsWith(':')) { clientParts.removeLast(); }
|
||||
if (clientParts.size() != clientSectionAttributes.size())
|
||||
{
|
||||
CLogMessage(getLogCategories()).warning("Client parts: %1 attributes: %2 line: '%3'") << clientParts.size() << clientSectionAttributes.size() << currentLine;
|
||||
logInconsistentData(
|
||||
CStatusMessage(static_cast<CVatsimDataFileReader *>(nullptr), CStatusMessage::SeverityInfo, QString("Client parts: %1 attributes: %2 line: '%3'").arg(clientParts.size()).arg(clientSectionAttributes.size()).arg(currentLine))
|
||||
);
|
||||
return parts;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("terminated METAR decoding process"); // for users
|
||||
CLogMessage(this).info("Terminated METAR decoding process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -117,7 +116,7 @@ namespace BlackCore
|
||||
while (!lineReader.atEnd())
|
||||
{
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
QString line = lineReader.readLine();
|
||||
const QString line = lineReader.readLine();
|
||||
CMetar metar = m_metarDecoder.decode(line);
|
||||
if (metar != CMetar()) { metars.push_back(metar); }
|
||||
else { invalidLines++; }
|
||||
|
||||
Reference in New Issue
Block a user