From 523ef71c87900a2db5f22a3a061c0f48a21b6beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Tue, 17 Dec 2019 07:59:25 +0100 Subject: [PATCH] [dataengine/geolocation] Add logging category Reviewers: apol, #plasma, crossi, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: davidedmundson, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26056 --- dataengines/geolocation/CMakeLists.txt | 1 + dataengines/geolocation/location_gps.cpp | 6 +++--- plasma-workspace.categories | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dataengines/geolocation/CMakeLists.txt b/dataengines/geolocation/CMakeLists.txt index 9ebde73af..e80c31d92 100644 --- a/dataengines/geolocation/CMakeLists.txt +++ b/dataengines/geolocation/CMakeLists.txt @@ -67,6 +67,7 @@ set_package_properties(libgps PROPERTIES DESCRIPTION "GPS support for geolocatio if(LIBGPS_FOUND) include_directories(${LIBGPS_INCLUDES} ${LIBGPS_INCLUDE_DIR}) set(plasma_geolocation_gps_SRCS location_gps.cpp) + ecm_qt_declare_logging_category(plasma_geolocation_gps_SRCS HEADER geolocdebug.h IDENTIFIER DATAENGINE_GEOLOCATION CATEGORY_NAME org.kde.plasma.dataengine.geolocation) add_library(plasma-geolocation-gps MODULE ${plasma_geolocation_gps_SRCS}) target_link_libraries(plasma-geolocation-gps plasma-geolocation-interface ${LIBGPS_LIBRARIES}) install(FILES plasma-geolocation-gps.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) diff --git a/dataengines/geolocation/location_gps.cpp b/dataengines/geolocation/location_gps.cpp index f06865e28..f8d31971f 100644 --- a/dataengines/geolocation/location_gps.cpp +++ b/dataengines/geolocation/location_gps.cpp @@ -16,7 +16,7 @@ */ #include "location_gps.h" -#include +#include "geolocdebug.h" Gpsd::Gpsd(gps_data_t* gpsdata) : m_gpsdata(gpsdata) @@ -90,12 +90,12 @@ Gps::Gps(QObject* parent, const QVariantList& args) gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT); if (m_gpsdata) { #endif - qDebug() << "gpsd found."; + qCDebug(DATAENGINE_GEOLOCATION)<< "gpsd found."; m_gpsd = new Gpsd(m_gpsdata); connect(m_gpsd, SIGNAL(dataReady(Plasma::DataEngine::Data)), this, SLOT(setData(Plasma::DataEngine::Data))); } else { - qDebug() << "gpsd not found"; + qCWarning(DATAENGINE_GEOLOCATION) << "gpsd not found"; } setIsAvailable(m_gpsd); diff --git a/plasma-workspace.categories b/plasma-workspace.categories index 73ecf01ab..a0fda1da3 100644 --- a/plasma-workspace.categories +++ b/plasma-workspace.categories @@ -2,3 +2,4 @@ org.kde.kf5.ksmserver ksmserver (ksmserver) IDENTIFIER [KSMSERVER] org.kde.plasma.runner.services Plasma Runner Services DEFAULT_SEVERITY [WARNING] IDENTIFIER [RUNNER_SERVICES] org.kde.plasma.runner.appstream Plasma Runner Appstream DEFAULT_SEVERITY [WARNING] IDENTIFIER [RUNNER_APPSTREAM] org.kde.plasma.runner.bookmarks Plasma Runner Bookmarks DEFAULT_SEVERITY [WARNING] IDENTIFIER [RUNNER_BOOKMARKS] +org.kde.plasma.dataengine.geolocation Plasma Data engine Geolocation DEFAULT_SEVERITY [WARNING] IDENTIFIER [DATAENGINE_GEOLOCATION]