diff options
author | Rainer Keller <Rainer.Keller@qt.io> | 2019-07-22 10:20:29 +0200 |
---|---|---|
committer | Rainer Keller <Rainer.Keller@qt.io> | 2019-07-22 10:27:38 +0200 |
commit | 78e32b82057b591971894a178d326e4675cd5f8b (patch) | |
tree | e0a1ece82e7cd7653830dd389a03d9cccc4e9ad9 | |
parent | cf265b032f29f9d27c3417ed99e4746dde0e4dd0 (diff) |
uacpp: Backend property for enabling additional debug output
Change-Id: I85761157be460876ee83a655d073012ea6848e84
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
-rw-r--r-- | src/opcua/core/qopcuaprovider.cpp | 5 | ||||
-rw-r--r-- | src/plugins/opcua/uacpp/quacppclient.cpp | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/opcua/core/qopcuaprovider.cpp b/src/opcua/core/qopcuaprovider.cpp index f3dc589..3a474a6 100644 --- a/src/opcua/core/qopcuaprovider.cpp +++ b/src/opcua/core/qopcuaprovider.cpp @@ -229,6 +229,11 @@ static QOpcUaPlugin *loadPlugin(const QString &key) \li Unified Automation \li By default, the backend refuses to connect to endpoints without encryption to avoid sending passwords in clear text. This parameter allows to disable this feature. + \row + \li enableVerboseDebugOutput + \li Unified Automation + \li Tells the backend to print additional output to the terminal. The backend specific logging + level is set to \c OPCUA_TRACE_OUTPUT_LEVEL_ALL. \endtable */ QOpcUaClient *QOpcUaProvider::createClient(const QString &backend, const QVariantMap &backendProperties) diff --git a/src/plugins/opcua/uacpp/quacppclient.cpp b/src/plugins/opcua/uacpp/quacppclient.cpp index dcf90a9..b453310 100644 --- a/src/plugins/opcua/uacpp/quacppclient.cpp +++ b/src/plugins/opcua/uacpp/quacppclient.cpp @@ -40,6 +40,8 @@ #include <QtCore/QUrl> #include <QtCore/QUuid> +#include <opcua_trace.h> + QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_UACPP) @@ -53,6 +55,12 @@ QUACppClient::QUACppClient(const QVariantMap &backendProperties) m_backend->m_disableEncryptedPasswordCheck = true; } + if (backendProperties.value(QLatin1String("enableVerboseDebugOutput"), false).toBool()) { + OpcUa_Trace_Initialize(); + OpcUa_Trace_ChangeTraceLevel(OPCUA_TRACE_OUTPUT_LEVEL_ALL); + OpcUa_Trace_Toggle(true); + } + m_thread = new QThread(); connectBackendWithClient(m_backend); m_backend->moveToThread(m_thread); |