From 328db7b395a1df970ccc641b2077c5c6ecbcf7de Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 5 Nov 2017 19:15:19 +0100 Subject: 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." filters. Change-Id: Ib39c0b2ebcd967cd7812602190807ad3488ccb18 Reviewed-by: Alex Blasche Reviewed-by: Denis Shienkov --- src/plugins/canbus/systeccan/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/canbus/systeccan/main.cpp') 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 #include +#include + 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; -- cgit v1.2.3