summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/systeccan/main.cpp
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-11-05 19:15:19 +0100
committerAndré Hartmann <aha_1980@gmx.de>2017-11-13 19:29:48 +0000
commit328db7b395a1df970ccc641b2077c5c6ecbcf7de (patch)
treedd3911db9dc995797e2d8cfbba08f56c645308fd /src/plugins/canbus/systeccan/main.cpp
parent9de99ca2d395037a092a9003cad3dbb7bb5fde98 (diff)
CAN: Introduce categorized logging
[ChangeLog][CAN bus] Introduced categorized logging to the CAN bus module which can be enabled by the "qt.canbus" and "qt.canbus.plugins.<pluginname>" filters. Change-Id: Ib39c0b2ebcd967cd7812602190807ad3488ccb18 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/plugins/canbus/systeccan/main.cpp')
-rw-r--r--src/plugins/canbus/systeccan/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/canbus/systeccan/main.cpp b/src/plugins/canbus/systeccan/main.cpp
index fcb76a3..89377a0 100644
--- a/src/plugins/canbus/systeccan/main.cpp
+++ b/src/plugins/canbus/systeccan/main.cpp
@@ -40,8 +40,12 @@
#include <QtSerialBus/qcanbusdevice.h>
#include <QtSerialBus/qcanbusfactory.h>
+#include <QtCore/qloggingcategory.h>
+
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(QT_CANBUS_PLUGINS_SYSTECCAN, "qt.canbus.plugins.systeccan")
+
class SystecCanBusPlugin : public QObject, public QCanBusFactoryV2
{
Q_OBJECT
@@ -61,7 +65,7 @@ public:
{
QString errorReason;
if (Q_UNLIKELY(!SystecCanBackend::canCreate(&errorReason))) {
- qWarning("%ls", qUtf16Printable(errorReason));
+ qCWarning(QT_CANBUS_PLUGINS_SYSTECCAN, "%ls", qUtf16Printable(errorReason));
if (errorMessage)
*errorMessage = errorReason;
return nullptr;