From 3b715960e97a201c780352d48977965195744d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 22 Apr 2016 10:54:11 +0200 Subject: [PATCH] fix debug outputs in denon --- libguh/plugin/deviceplugin.cpp | 2 +- plugins/deviceplugins/denon/deviceplugindenon.cpp | 14 +++++++------- plugins/deviceplugins/mock/devicepluginmock.cpp | 2 +- server/httpreply.cpp | 3 ++- server/httprequest.cpp | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libguh/plugin/deviceplugin.cpp b/libguh/plugin/deviceplugin.cpp index 94efe2f1..041caf8a 100644 --- a/libguh/plugin/deviceplugin.cpp +++ b/libguh/plugin/deviceplugin.cpp @@ -388,7 +388,7 @@ DeviceManager::DeviceError DevicePlugin::displayPin(const PairingTransactionId & Q_UNUSED(pairingTransactionId) Q_UNUSED(deviceDescriptor) - qWarning() << "Plugin does not implement the display pin setup method."; + qCWarning(dcDeviceManager) << "Plugin does not implement the display pin setup method."; return DeviceManager::DeviceErrorNoError; } diff --git a/plugins/deviceplugins/denon/deviceplugindenon.cpp b/plugins/deviceplugins/denon/deviceplugindenon.cpp index d2ecf696..d5656fac 100644 --- a/plugins/deviceplugins/denon/deviceplugindenon.cpp +++ b/plugins/deviceplugins/denon/deviceplugindenon.cpp @@ -60,13 +60,13 @@ DeviceManager::DeviceSetupStatus DevicePluginDenon::setupDevice(Device *device) // Check if we already have a denon device if (!myDevices().isEmpty()) { - qCWarning(dcDenon()) << "Could not add denon device. Only one denon device allowed."; + qCWarning(dcDenon) << "Could not add denon device. Only one denon device allowed."; return DeviceManager::DeviceSetupStatusFailure; } QHostAddress address(device->paramValue("ip").toString()); if (address.isNull()) { - qCWarning(dcDenon()) << "Could not parse ip address" << device->paramValue("ip").toString(); + qCWarning(dcDenon) << "Could not parse ip address" << device->paramValue("ip").toString(); return DeviceManager::DeviceSetupStatusFailure; } @@ -182,7 +182,7 @@ void DevicePluginDenon::onConnectionChanged() void DevicePluginDenon::onDataReceived(const QByteArray &data) { - qDebug(dcDenon) << "Data received" << data; + qCDebug(dcDenon) << "Data received" << data; // if there is no device, return if (m_device.isNull()) @@ -192,7 +192,7 @@ void DevicePluginDenon::onDataReceived(const QByteArray &data) int index = data.indexOf("MV"); int vol = data.mid(index+2, 2).toInt(); - qDebug(dcDenon) << "Update volume:" << vol; + qCDebug(dcDenon) << "Update volume:" << vol; m_device->setStateValue(volumeStateTypeId, vol); } @@ -240,15 +240,15 @@ void DevicePluginDenon::onDataReceived(const QByteArray &data) cmd = "FVP"; } - qDebug(dcDenon) << "Update channel:" << cmd; + qCDebug(dcDenon) << "Update channel:" << cmd; m_device->setStateValue(channelStateTypeId, cmd); } if (data.contains("PWON")) { - qDebug(dcDenon) << "Update power on"; + qCDebug(dcDenon) << "Update power on"; m_device->setStateValue(powerStateTypeId, true); } else if (data.contains("PWSTANDBY")) { - qDebug(dcDenon) << "Update power off"; + qCDebug(dcDenon) << "Update power off"; m_device->setStateValue(powerStateTypeId, false); } } diff --git a/plugins/deviceplugins/mock/devicepluginmock.cpp b/plugins/deviceplugins/mock/devicepluginmock.cpp index 3aff9643..644c2ca8 100644 --- a/plugins/deviceplugins/mock/devicepluginmock.cpp +++ b/plugins/deviceplugins/mock/devicepluginmock.cpp @@ -335,7 +335,7 @@ void DevicePluginMock::emitPushButtonDevicesDiscovered() m_pushbuttonPressed = false; QTimer::singleShot(3000, this, SLOT(onPushButtonPressed())); - qDebug() << "Start PushButton timer (will be pressed in 3 second)"; + qCDebug(dcMockDevice) << "Start PushButton timer (will be pressed in 3 second)"; } void DevicePluginMock::emitDisplayPinDevicesDiscovered() diff --git a/server/httpreply.cpp b/server/httpreply.cpp index 7f99d464..ba42f3af 100644 --- a/server/httpreply.cpp +++ b/server/httpreply.cpp @@ -130,6 +130,7 @@ #include "httpreply.h" +#include "loggingcategories.h" #include #include @@ -416,7 +417,7 @@ void HttpReply::startWait() void HttpReply::timeout() { - qDebug() << "Http reply timeout"; + qCDebug(dcWebServer) << "Http reply timeout"; m_timedOut = true; emit finished(); } diff --git a/server/httprequest.cpp b/server/httprequest.cpp index 662cdacc..3d5615b4 100644 --- a/server/httprequest.cpp +++ b/server/httprequest.cpp @@ -216,7 +216,7 @@ void HttpRequest::validate() // check User-Agent if (!m_rawHeaderList.contains("User-Agent")) - qWarning() << "User-Agent header is missing"; + qCWarning(dcWebServer) << "User-Agent header is missing"; // verify content length with actual payload