diff --git a/externals b/externals index 51305ae2a..cdeeb245d 160000 --- a/externals +++ b/externals @@ -1 +1 @@ -Subproject commit 51305ae2a6b6ff06b8c63537b6c9577cffc57fa1 +Subproject commit cdeeb245d52f6b4af99187348eda144a147a09bc diff --git a/src/blackcore/vatsim/networkvatlib.cpp b/src/blackcore/vatsim/networkvatlib.cpp index cd0861c54..1a70a941f 100644 --- a/src/blackcore/vatsim/networkvatlib.cpp +++ b/src/blackcore/vatsim/networkvatlib.cpp @@ -95,7 +95,7 @@ namespace BlackCore Q_ASSERT_X(Vat_GetVersion() == VAT_LIBVATLIB_VERSION, "swift.network", "Wrong vatlib shared library installed"); - Vat_SetNetworkLogHandler(SeverityLevel::SeverityError, CNetworkVatlib::networkLogHandler); + Vat_SetNetworkLogHandler(vatSeverityError, CNetworkVatlib::networkLogHandler); m_processingTimer.setObjectName(this->objectName().append(":m_processingTimer")); m_positionUpdateTimer.setObjectName(this->objectName().append(":m_positionUpdateTimer")); @@ -1453,7 +1453,7 @@ namespace BlackCore ); } - void CNetworkVatlib::networkLogHandler(SeverityLevel /** severity **/, const char *context, const char *message) + void CNetworkVatlib::networkLogHandler(VatSeverityLevel /** severity **/, const char *context, const char *message) { const QString errorMessage = QStringLiteral("vatlib ") % context % QStringLiteral(": ") % message; CLogMessage(static_cast(nullptr)).error(errorMessage); diff --git a/src/blackcore/vatsim/networkvatlib.h b/src/blackcore/vatsim/networkvatlib.h index 4c983d793..42a1f047c 100644 --- a/src/blackcore/vatsim/networkvatlib.h +++ b/src/blackcore/vatsim/networkvatlib.h @@ -187,7 +187,7 @@ namespace BlackCore bool isDisconnected() const { return m_status != vatStatusConnecting && m_status != vatStatusConnected; } static QString convertToUnicodeEscaped(const QString &str); static VatSimType convertToSimType(BlackMisc::Simulation::CSimulatorPluginInfo &simInfo); - static void networkLogHandler(SeverityLevel severity, const char *context, const char *message); + static void networkLogHandler(VatSeverityLevel severity, const char *context, const char *message); void sendCustomPacket(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data); static const QString &defaultModelString() diff --git a/src/blackcore/vatsim/voicevatlib.cpp b/src/blackcore/vatsim/voicevatlib.cpp index 3a4475a38..b22722786 100644 --- a/src/blackcore/vatsim/voicevatlib.cpp +++ b/src/blackcore/vatsim/voicevatlib.cpp @@ -38,7 +38,7 @@ namespace BlackCore m_audioService(Vat_CreateAudioService()) { const int udpPort = m_vatsimVoiceSettings.get().getVatsimUdpVoicePort(); - Vat_SetVoiceLogHandler(SeverityLevel::SeverityError, CVoiceVatlib::voiceLogHandler); + Vat_SetVoiceLogHandler(vatSeverityDebug, CVoiceVatlib::voiceLogHandler); m_udpPort.reset(Vat_CreateUDPAudioPort(m_audioService.data(), udpPort)); // do processing @@ -155,13 +155,15 @@ namespace BlackCore Vat_ExecuteVoiceTasks(m_audioService.data()); } - void CVoiceVatlib::voiceLogHandler(SeverityLevel /** severity **/, const char *context, const char *message) + void CVoiceVatlib::voiceLogHandler(VatSeverityLevel severity, const char *context, const char *message) { - QString errorMessage("vatlib "); - errorMessage += context; - errorMessage += ": "; - errorMessage += message; - CLogMessage(static_cast(nullptr)).error(errorMessage); + QString logMessage(context); + logMessage += ": "; + logMessage += message; + if (severity == vatSeverityDebug) { CLogMessage(static_cast(nullptr)).debug(logMessage); } + else if (severity == vatSeverityInfo) { CLogMessage(static_cast(nullptr)).info(logMessage); } + else if (severity == vatSeverityWarning) { CLogMessage(static_cast(nullptr)).warning(logMessage); } + else if (severity == vatSeverityError) { CLogMessage(static_cast(nullptr)).error(logMessage); } } } // namespace } // namespace diff --git a/src/blackcore/vatsim/voicevatlib.h b/src/blackcore/vatsim/voicevatlib.h index 63d85fab8..13ba7dfc1 100644 --- a/src/blackcore/vatsim/voicevatlib.h +++ b/src/blackcore/vatsim/voicevatlib.h @@ -122,7 +122,7 @@ namespace BlackCore } }; - static void voiceLogHandler(SeverityLevel severity, const char *context, const char *message); + static void voiceLogHandler(VatSeverityLevel severity, const char *context, const char *message); BlackMisc::CSetting m_vatsimVoiceSettings { this }; QScopedPointer m_audioService;