diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2013-12-16 16:02:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-20 09:06:10 +0100 |
commit | 94f862e2786c5e9b558ae6ab6f524842949c0953 (patch) | |
tree | 8905bcdae7592fb1ca26ea43e3330b03b62dbede /src/bluetooth/qbluetoothserver_bluez.cpp | |
parent | f661b7fbb19d845b23450c57127020ee86df578d (diff) |
Use QLoggingCategory to categorize the various debug output streams
Task-number: QTBUG-32253
Change-Id: I193162407d0fc7eca83689e31f03e1641a494ab0
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothserver_bluez.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothserver_bluez.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp index e8457183..cf50d140 100644 --- a/src/bluetooth/qbluetoothserver_bluez.cpp +++ b/src/bluetooth/qbluetoothserver_bluez.cpp @@ -43,10 +43,9 @@ #include "qbluetoothserver_p.h" #include "qbluetoothsocket.h" +#include <QtCore/QLoggingCategory> #include <QtCore/QSocketNotifier> -#include <QtCore/QDebug> - #include <bluetooth/bluetooth.h> #include <bluetooth/rfcomm.h> #include <bluetooth/l2cap.h> @@ -55,6 +54,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) + static inline void convertAddress(quint64 from, quint8 (&to)[6]) { to[0] = (from >> 0) & 0xff; @@ -252,11 +253,11 @@ void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) if (security.testFlag(QBluetooth::Secure)) lm |= RFCOMM_LM_SECURE; - //qDebug() << hex << "Setting lm to" << lm << security; + qCDebug(QT_BT_BLUEZ()) << hex << "Setting lm to" << lm << security; if (setsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0){ - qWarning() << "Failed to set socket option, closing socket for safety" << errno; - qWarning() << "Error: " << strerror(errno); + qCWarning(QT_BT_BLUEZ) << "Failed to set socket option, closing socket for safety" << errno; + qCWarning(QT_BT_BLUEZ) << "Error: " << strerror(errno); d->m_lastError = InputOutputError; emit error(d->m_lastError); d->socket->close(); @@ -272,8 +273,8 @@ void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) lm |= L2CAP_LM_SECURE; if (setsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0){ - qWarning() << "Failed to set socket option, closing socket for safety" << errno; - qWarning() << "Error: " << strerror(errno); + qCWarning(QT_BT_BLUEZ) << "Failed to set socket option, closing socket for safety" << errno; + qCWarning(QT_BT_BLUEZ) << "Error: " << strerror(errno); d->m_lastError = InputOutputError; emit error(d->m_lastError); d->socket->close(); @@ -292,7 +293,7 @@ QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { if (getsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, (socklen_t *)&len) < 0) { - qWarning() << "Failed to get security flags" << strerror(errno); + qCWarning(QT_BT_BLUEZ) << "Failed to get security flags" << strerror(errno); return QBluetooth::NoSecurity; } @@ -309,7 +310,7 @@ QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const security |= QBluetooth::Authorization; } else { if (getsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, (socklen_t *)&len) < 0) { - qWarning() << "Failed to get security flags" << strerror(errno); + qCWarning(QT_BT_BLUEZ) << "Failed to get security flags" << strerror(errno); return QBluetooth::NoSecurity; } |