diff --git a/debian/guhd.1 b/debian/guhd.1 index 19fd530e..4e9960ce 100644 --- a/debian/guhd.1 +++ b/debian/guhd.1 @@ -27,27 +27,33 @@ Debug categories to enable. Prefix with \"No\" to disable. Warnings from all categories will be printed unless explicitly muted with "NoWarnings". .RS .TP -Categories are: +\fBMain\ debug\ categories:\fR .IP \fIApplication\fR\ (default\ enabled) Print the debug messages from the core application. -.IP \fICommandLauncher\fR\ (default\ disabled) -Print the debug messages from the command launcher device plugin. .IP \fIConnection\fR\ (default\ enabled) Print the debug messages from the TCP connections in guh. .IP \fIDeviceManager\fR\ (default\ enabled) Print the debug messages from the device manager. -.IP \fIEQ-3\fR\ (default\ disabled) -Print the debug messages from eQ-3 device plugin. .IP \fIHardware\fR\ (default\ disabled) Print the debug messages from hardware resources in guh. .IP \fIJsonRpc\fR\ (default\ disabled) Print the debug messages from JSON-RPC interface. +.IP \fILogEngine\fR\ (default\ disabled) +Print the debug messages from logging engine. +.IP \fIRuleEngine\fR\ (default\ enabled) +Print the debug messages from the rule engine. +.TP +\fBDebug\ categories\ for\ plugins:\fR +.IP \fICommandLauncher\fR\ (default\ disabled) +Print the debug messages from the command launcher device plugin. +.IP \fIDateTime\fR\ (default\ disabled) +Print the debug messages from the date/time device plugin. +.IP \fIEQ-3\fR\ (default\ disabled) +Print the debug messages from eQ-3 device plugin. .IP \fILgSmartTv\fR\ (default\ disabled) Print the debug messages from Lg Smart Tv device plugin. .IP \fILircd\fR\ (default\ disabled) Print the debug messages from lircd device plugin. -.IP \fILogEngine\fR\ (default\ disabled) -Print the debug messages from logging engine. .IP \fIMailNotification\fR\ (default\ disabled) Print the debug messages from the mail notification device plugin. .IP \fIMock\fR\ (default\ disabled) @@ -59,8 +65,6 @@ Print the debug messages from the Philips Hue device plugin. .IP \fIRF433\fR\ (default\ disabled) Print the debug messages from the RF 433 MHz plugins. Each plugin which uses the RF 433 MHz hardware resource is in this debug caterogry. -.IP \fIRuleEngine\fR\ (default\ enabled) -Print the debug messages from the rule engine. .IP \fITune\fR\ (default\ disabled) Print the debug messages from the tune device plugin. .IP \fIUdpCommander\fR\ (default\ disabled) diff --git a/libguh/loggingcategories.cpp b/libguh/loggingcategories.cpp index fff6fec0..59d9550b 100644 --- a/libguh/loggingcategories.cpp +++ b/libguh/loggingcategories.cpp @@ -35,6 +35,7 @@ Q_LOGGING_CATEGORY(dcBoblight, "Boblight") Q_LOGGING_CATEGORY(dcCommandLauncher, "CommandLauncher") Q_LOGGING_CATEGORY(dcRF433, "RF433") +Q_LOGGING_CATEGORY(dcDateTime, "DateTime") Q_LOGGING_CATEGORY(dcEQ3, "EQ-3") Q_LOGGING_CATEGORY(dcLgSmartTv, "LgSmartTv") Q_LOGGING_CATEGORY(dcLircd, "Lircd") diff --git a/libguh/loggingcategories.h b/libguh/loggingcategories.h index 9cf2a85e..41d55a91 100644 --- a/libguh/loggingcategories.h +++ b/libguh/loggingcategories.h @@ -40,6 +40,7 @@ Q_DECLARE_LOGGING_CATEGORY(dcBoblight) Q_DECLARE_LOGGING_CATEGORY(dcCommandLauncher) Q_DECLARE_LOGGING_CATEGORY(dcRF433) +Q_DECLARE_LOGGING_CATEGORY(dcDateTime) Q_DECLARE_LOGGING_CATEGORY(dcEQ3) Q_DECLARE_LOGGING_CATEGORY(dcLgSmartTv) Q_DECLARE_LOGGING_CATEGORY(dcLircd) diff --git a/plugins/deviceplugins/datetime/deviceplugindatetime.cpp b/plugins/deviceplugins/datetime/deviceplugindatetime.cpp index 38b7f5aa..87097d42 100644 --- a/plugins/deviceplugins/datetime/deviceplugindatetime.cpp +++ b/plugins/deviceplugins/datetime/deviceplugindatetime.cpp @@ -82,6 +82,7 @@ #include "plugin/device.h" #include "devicemanager.h" #include "plugininfo.h" +#include "loggingcategories.h" #include @@ -110,7 +111,7 @@ DeviceManager::DeviceSetupStatus DevicePluginDateTime::setupDevice(Device *devic if(m_timeZone.isValid()){ QDateTime zoneTime = QDateTime(QDate::currentDate(), QTime::currentTime(), m_timeZone).toLocalTime(); - qDebug() << zoneTime.toLocalTime().date() << zoneTime.toLocalTime().time() << QLocale::countryToString(m_timeZone.country()); + qCDebug(dcDateTime) << zoneTime.toLocalTime().date() << zoneTime.toLocalTime().time() << QLocale::countryToString(m_timeZone.country()); m_timer->start(); return DeviceManager::DeviceSetupStatusSuccess; diff --git a/plugins/deviceplugins/lgsmarttv/tveventhandler.cpp b/plugins/deviceplugins/lgsmarttv/tveventhandler.cpp index 5d681426..d9eff7e3 100644 --- a/plugins/deviceplugins/lgsmarttv/tveventhandler.cpp +++ b/plugins/deviceplugins/lgsmarttv/tveventhandler.cpp @@ -55,7 +55,7 @@ void TvEventHandler::readClient() // reject everything, except the tv if(socket->peerAddress() != m_host){ - qWarning() << "reject connection from " << socket->peerAddress().toString(); + qCWarning(dcLgSmartTv) << "reject connection from " << socket->peerAddress().toString(); socket->close(); if (socket->state() == QTcpSocket::UnconnectedState) { delete socket; diff --git a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp index e6c53873..1c51e4de 100644 --- a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp +++ b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp @@ -130,7 +130,7 @@ void DevicePluginOpenweathermap::deviceRemoved(Device *device) void DevicePluginOpenweathermap::networkManagerReplyReady(QNetworkReply *reply) { if (reply->error()) { - qWarning() << "ERROR: OpenWeatherMap reply error: " << reply->errorString(); + qCWarning(dcOpenweathermap) << "OpenWeatherMap reply error: " << reply->errorString(); } if (m_autodetectionReplies.contains(reply)) { @@ -219,7 +219,7 @@ void DevicePluginOpenweathermap::processAutodetectResponse(QByteArray data) QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &error); if(error.error != QJsonParseError::NoError) { - qWarning() << "failed to parse data" << data << ":" << error.errorString(); + qCWarning(dcOpenweathermap) << "failed to parse data" << data << ":" << error.errorString(); } // search by geographic coordinates diff --git a/server/main.cpp b/server/main.cpp index f75e516e..e555d2a1 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -68,6 +68,7 @@ int main(int argc, char *argv[]) #endif s_loggingFilters.insert("CommandLauncher", false); s_loggingFilters.insert("RF433", false); + s_loggingFilters.insert("DateTime", false); s_loggingFilters.insert("EQ-3", false); s_loggingFilters.insert("LgSmartTv", false); s_loggingFilters.insert("Lircd", false); @@ -113,7 +114,7 @@ int main(int argc, char *argv[]) if (s_loggingFilters.contains(debugArea)) { s_loggingFilters[debugArea] = enable; } else { - qWarning() << "No such debug category:" << debugArea; + qCWarning(dcApplication) << "No such debug category:" << debugArea; } } QLoggingCategory::installFilter(loggingCategoryFilter);