added datetime logging category and update man page

This commit is contained in:
Simon Stürz 2015-06-21 17:24:23 +02:00 committed by Michael Zanetti
parent 5bbf1fc70b
commit 6d7984496e
7 changed files with 22 additions and 14 deletions

22
debian/guhd.1 vendored
View File

@ -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)

View File

@ -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")

View File

@ -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)

View File

@ -82,6 +82,7 @@
#include "plugin/device.h"
#include "devicemanager.h"
#include "plugininfo.h"
#include "loggingcategories.h"
#include <QDebug>
@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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);