diff --git a/python/plugins/MetaSearch/dialogs/maindialog.py b/python/plugins/MetaSearch/dialogs/maindialog.py
index 36ece1f5c57b..3bcadc5f3a2e 100644
--- a/python/plugins/MetaSearch/dialogs/maindialog.py
+++ b/python/plugins/MetaSearch/dialogs/maindialog.py
@@ -119,6 +119,9 @@ def __init__(self, iface):
self.disable_ssl_verification = self.settings.value(
"/MetaSearch/disableSSL", False, bool
)
+ self.log_debugging_messages = self.settings.value(
+ "/MetaSearch/logDebugging", False, bool
+ )
# Services tab
self.cmbConnectionsServices.activated.connect(self.save_connection)
@@ -181,6 +184,10 @@ def _on_ssl_state_change(state):
self.settings.setValue("/MetaSearch/disableSSL", bool(state))
self.disable_ssl_verification = bool(state)
+ def _on_debugging_state_change(state):
+ self.settings.setValue("/MetaSearch/logDebugging", bool(state))
+ self.log_debugging_messages = bool(state)
+
self.tabWidget.setCurrentIndex(0)
self.populate_connection_list()
self.btnRawAPIResponse.setEnabled(False)
@@ -192,6 +199,8 @@ def _on_ssl_state_change(state):
self.spnTimeout.valueChanged.connect(_on_timeout_change)
self.disableSSLVerification.setChecked(self.disable_ssl_verification)
self.disableSSLVerification.stateChanged.connect(_on_ssl_state_change)
+ self.logDebuggingMessages.setChecked(self.log_debugging_messages)
+ self.logDebuggingMessages.stateChanged.connect(_on_debugging_state_change)
key = "/MetaSearch/%s" % self.cmbConnectionsSearch.currentText()
self.catalog_url = self.settings.value("%s/url" % key)
diff --git a/python/plugins/MetaSearch/ui/maindialog.ui b/python/plugins/MetaSearch/ui/maindialog.ui
index f45648f5acdc..fc18c629fe64 100644
--- a/python/plugins/MetaSearch/ui/maindialog.ui
+++ b/python/plugins/MetaSearch/ui/maindialog.ui
@@ -558,6 +558,36 @@
+ -
+
+
+ Debugging
+
+
+
-
+
+
+ Log debugging messages
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
-
diff --git a/python/plugins/MetaSearch/util.py b/python/plugins/MetaSearch/util.py
index a939604f5809..e5607b61d201 100644
--- a/python/plugins/MetaSearch/util.py
+++ b/python/plugins/MetaSearch/util.py
@@ -174,4 +174,6 @@ def clean_ows_url(url):
def log_message(message, level=Qgis.MessageLevel.Info):
"""helper function to emit logging messages"""
- LOGGER.logMessage(message, "MetaSearch", level)
+ logging = QgsSettings().value("/MetaSearch/logDebugging", False, bool)
+ if logging:
+ LOGGER.logMessage(message, "MetaSearch", level)