From aa98526cb091f1a20c3636401205faea92c3ad51 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 9 Jan 2021 17:01:35 -0800 Subject: [PATCH] Add new VideoAllLog category which turns on all individual video logging categories Fix QCWarning --- src/QGCLoggingCategory.cc | 34 ++++++++++++++++++++++++++-------- src/QGCLoggingCategory.h | 1 + src/VideoReceiver/GStreamer.cc | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/QGCLoggingCategory.cc b/src/QGCLoggingCategory.cc index d3329b0..e2a9473 100644 --- a/src/QGCLoggingCategory.cc +++ b/src/QGCLoggingCategory.cc @@ -15,6 +15,8 @@ #include +static const char* kVideoAllLogCategory = "VideoAllLog"; + // Add Global logging categories (not class specific) here using QGC_LOGGING_CATEGORY QGC_LOGGING_CATEGORY(FirmwareUpgradeLog, "FirmwareUpgradeLog") QGC_LOGGING_CATEGORY(FirmwareUpgradeVerboseLog, "FirmwareUpgradeVerboseLog") @@ -26,6 +28,7 @@ QGC_LOGGING_CATEGORY(RTKGPSLog, "RTKGPSLog") QGC_LOGGING_CATEGORY(GuidedActionsControllerLog, "GuidedActionsControllerLog") QGC_LOGGING_CATEGORY(ADSBVehicleManagerLog, "ADSBVehicleManagerLog") QGC_LOGGING_CATEGORY(LocalizationLog, "LocalizationLog") +QGC_LOGGING_CATEGORY(VideoAllLog, kVideoAllLogCategory) QGCLoggingCategoryRegister* _instance = nullptr; const char* QGCLoggingCategoryRegister::_filterRulesSettingsGroup = "LoggingFilters"; @@ -64,18 +67,23 @@ bool QGCLoggingCategoryRegister::categoryLoggingOn(const QString& category) void QGCLoggingCategoryRegister::setFilterRulesFromSettings(const QString& commandLineLoggingOptions) { + QString filterRules; + QString filterRuleFormat("%1.debug=true\n"); + bool videoAllLogSet = false; + if (!commandLineLoggingOptions.isEmpty()) { _commandLineLoggingOptions = commandLineLoggingOptions; } - QString filterRules; filterRules += "*Log.debug=false\n"; // Set up filters defined in settings foreach (QString category, _registeredCategories) { if (categoryLoggingOn(category)) { - filterRules += category; - filterRules += ".debug=true\n"; + filterRules += filterRuleFormat.arg(category); + if (category == kVideoAllLogCategory) { + videoAllLogSet = true; + } } } @@ -86,17 +94,27 @@ void QGCLoggingCategoryRegister::setFilterRulesFromSettings(const QString& comma if (logList[0] == "full") { filterRules += "*Log.debug=true\n"; for(int i=1; i