From 6a66ab84c24b1177290eb414cfe9736784c74436 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 16 Nov 2016 02:57:58 +0100 Subject: [PATCH] Added log categories for driver/plugin --- src/blackcore/simulatorcommon.cpp | 6 ++++++ src/blackcore/simulatorcommon.h | 4 +++- src/blackmisc/logcategory.h | 16 ++++++++++++++++ src/blackmisc/logpattern.cpp | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/blackcore/simulatorcommon.cpp b/src/blackcore/simulatorcommon.cpp index 1c7e4ef84..240d94426 100644 --- a/src/blackcore/simulatorcommon.cpp +++ b/src/blackcore/simulatorcommon.cpp @@ -76,6 +76,12 @@ namespace BlackCore CLogMessage(this).info("Initialized simulator driver %1") << m_simulatorPluginInfo.toQString(); } + const CLogCategoryList &CSimulatorCommon::getLogCategories() + { + static const CLogCategoryList cats( { CLogCategory::driver(), CLogCategory::plugin() }); + return cats; + } + CSimulatorCommon::~CSimulatorCommon() { } bool CSimulatorCommon::logicallyAddRemoteAircraft(const CSimulatedAircraft &remoteAircraft) diff --git a/src/blackcore/simulatorcommon.h b/src/blackcore/simulatorcommon.h index 33e29701c..737a6f41b 100644 --- a/src/blackcore/simulatorcommon.h +++ b/src/blackcore/simulatorcommon.h @@ -63,6 +63,9 @@ namespace BlackCore Q_OBJECT public: + //! Log categories + static const BlackMisc::CLogCategoryList &getLogCategories(); + //! Destructor virtual ~CSimulatorCommon(); @@ -79,7 +82,6 @@ namespace BlackCore //! @} protected slots: - //! \name Connected with remote aircraft provider signals //! @{ //! Slow timer used to highlight aircraft, can be used for other things too diff --git a/src/blackmisc/logcategory.h b/src/blackmisc/logcategory.h index 0a89b1eb0..fb26f2fad 100644 --- a/src/blackmisc/logcategory.h +++ b/src/blackmisc/logcategory.h @@ -124,6 +124,20 @@ namespace BlackMisc return cat; } + //! Driver + static const CLogCategory &driver() + { + static const CLogCategory cat { "swift.driver" }; + return cat; + } + + //! Plugin + static const CLogCategory &plugin() + { + static const CLogCategory cat { "swift.plugin" }; + return cat; + } + //! Background task static const CLogCategory &worker() { @@ -170,10 +184,12 @@ namespace BlackMisc context(), contextSlot(), download(), + driver(), guiComponent(), mapping(), matching(), network(), + plugin(), swiftDbWebservice(), services(), settings(), diff --git a/src/blackmisc/logpattern.cpp b/src/blackmisc/logpattern.cpp index 700d28bf4..2845a152b 100644 --- a/src/blackmisc/logpattern.cpp +++ b/src/blackmisc/logpattern.cpp @@ -30,6 +30,8 @@ namespace BlackMisc { "services", exactMatch(CLogCategory::services()) }, { "settings", exactMatch(CLogCategory::settings()) }, { "cache", exactMatch(CLogCategory::cache()) }, + { "driver", exactMatch(CLogCategory::driver()) }, + { "plugin", exactMatch(CLogCategory::plugin()) }, { "background task", exactMatch(CLogCategory::worker()) }, { "model mapping", exactMatch(CLogCategory::mapping()) }, { "model matching", exactMatch(CLogCategory::matching()) },