From 4fb30fdbc35643a290daf3bd6dedd1eb2393006c Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 6 Nov 2017 18:05:56 +0100 Subject: [PATCH] Ref T180, log pattern for cmd. line and logging some cmd line activities --- src/blackmisc/logcategory.h | 8 ++++ src/blackmisc/logpattern.cpp | 40 +++++++++---------- .../simulator/fscommon/simulatorfscommon.cpp | 1 + .../fsxcommon/simulatorfsxcommon.cpp | 1 + 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/blackmisc/logcategory.h b/src/blackmisc/logcategory.h index 5777c98ae..99e4f19e8 100644 --- a/src/blackmisc/logcategory.h +++ b/src/blackmisc/logcategory.h @@ -124,6 +124,13 @@ namespace BlackMisc return cat; } + //! Cmd.line parsing + static const CLogCategory &cmdLine() + { + static const CLogCategory cat { "swift.cmdLine" }; + return cat; + } + //! Driver static const CLogCategory &driver() { @@ -244,6 +251,7 @@ namespace BlackMisc { uncategorized(), cache(), + cmdLine(), context(), contextSlot(), dataInconsistency(), diff --git a/src/blackmisc/logpattern.cpp b/src/blackmisc/logpattern.cpp index e18ec6594..5b49348d0 100644 --- a/src/blackmisc/logpattern.cpp +++ b/src/blackmisc/logpattern.cpp @@ -25,35 +25,35 @@ namespace BlackMisc static const QHash patterns { { "uncategorized (swift)", exactMatch(CLogCategory::uncategorized()) }, - { "validation", exactMatch(CLogCategory::validation()) }, - { "verification", exactMatch(CLogCategory::verification()) }, - { "services", exactMatch(CLogCategory::services()) }, - { "settings", exactMatch(CLogCategory::settings()) }, - { "cache", exactMatch(CLogCategory::cache()) }, - { "driver", exactMatch(CLogCategory::driver()) }, - { "plugin", exactMatch(CLogCategory::plugin()) }, - { "wizard", exactMatch(CLogCategory::wizard()) }, { "background task", exactMatch(CLogCategory::worker()) }, + { "cache", exactMatch(CLogCategory::cache()) }, + { "cmd.line handling", exactMatch(CLogCategory::cmdLine()) }, + { "data inconsistency", exactMatch(CLogCategory::dataInconsistency()) }, + { "downloading data", exactMatch(CLogCategory::download()) }, + { "driver", exactMatch(CLogCategory::driver()) }, + { "model cache", exactMatch(CLogCategory::modelCache()) }, + { "model GUI", exactMatch(CLogCategory::modelGui()) }, + { "model loader", exactMatch(CLogCategory::modelLoader()) }, { "model mapping", exactMatch(CLogCategory::mapping()) }, { "model matching", exactMatch(CLogCategory::matching()) }, - { "model loader", exactMatch(CLogCategory::modelLoader()) }, - { "model cache", exactMatch(CLogCategory::modelCache()) }, { "model set cache", exactMatch(CLogCategory::modelSetCache()) }, - { "model GUI", exactMatch(CLogCategory::modelGui()) }, { "network (flight)", exactMatch(CLogCategory::network()) }, - { "swift contexts", exactMatch(CLogCategory::context()) }, - { "swift context slots", exactMatch(CLogCategory::contextSlot()) }, - { "swift GUI", exactMatch(CLogCategory::guiComponent()) }, - { "downloading data", exactMatch(CLogCategory::download()) }, - { "VATSIM specific", exactMatch(CLogCategory::vatsimSpecific()) }, - { "webservice related", exactMatch(CLogCategory::webservice()) }, - { "data inconsistency", exactMatch(CLogCategory::dataInconsistency()) }, + { "plugin", exactMatch(CLogCategory::plugin()) }, + { "services", exactMatch(CLogCategory::services()) }, + { "settings", exactMatch(CLogCategory::settings()) }, { "startup phase", exactMatch(CLogCategory::startup()) }, - { "swift DB webservice related", exactMatch(CLogCategory::swiftDbWebservice()) }, + { "swift context slots", exactMatch(CLogCategory::contextSlot()) }, + { "swift contexts", exactMatch(CLogCategory::context()) }, { "swift core", exactMatch(CLogCategory::swiftCore()) }, { "swift data tool", exactMatch(CLogCategory::swiftDataTool()) }, + { "swift DB webservice related", exactMatch(CLogCategory::swiftDbWebservice()) }, + { "swift GUI", exactMatch(CLogCategory::guiComponent()) }, { "swift pilot client", exactMatch(CLogCategory::swiftPilotClient()) }, - + { "validation", exactMatch(CLogCategory::validation()) }, + { "VATSIM specific", exactMatch(CLogCategory::vatsimSpecific()) }, + { "verification", exactMatch(CLogCategory::verification()) }, + { "webservice related", exactMatch(CLogCategory::webservice()) }, + { "wizard", exactMatch(CLogCategory::wizard()) }, { "Qt library", startsWith("qt.") }, { "uncategorized (default)", exactMatch("default") }, { "uncategorized (none)", empty() } diff --git a/src/plugins/simulator/fscommon/simulatorfscommon.cpp b/src/plugins/simulator/fscommon/simulatorfscommon.cpp index 255a8407c..d1b3e1948 100644 --- a/src/plugins/simulator/fscommon/simulatorfscommon.cpp +++ b/src/plugins/simulator/fscommon/simulatorfscommon.cpp @@ -62,6 +62,7 @@ namespace BlackSimPlugin { const bool on = parser.toBool(2); const bool s = this->useFsuipc(on); + CLogMessage(this, CLogCategory::cmdLine()).info("FSUIPC is '%1'") << boolToOnOff(s); return s; } return false; diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 6b3611fc4..a9d465bea 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -740,6 +740,7 @@ namespace BlackSimPlugin { const bool trace = parser.toBool(2); this->setTraceSendId(trace); + CLogMessage(this, CLogCategory::cmdLine()).info("Tracing FSX/P3D driver sendIds is '%1'") << boolToOnOff(trace); return true; } return CSimulatorFsCommon::parseDetails(parser);