SSH: Use categorized logging.

Change-Id: I9890c7d4a86320c835e70e66c523c5a2f7b41421
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2016-01-14 17:11:03 +01:00
parent 54d64971d8
commit b72c3cba24
18 changed files with 166 additions and 156 deletions

View File

@@ -39,6 +39,7 @@
#include "sshexception_p.h"
#include "sshinit_p.h"
#include "sshkeyexchange_p.h"
#include "sshlogging_p.h"
#include "sshremoteprocess.h"
#include <botan/botan.h>
@@ -196,7 +197,7 @@ int SshConnection::closeAllChannels()
try {
return d->m_channelManager->closeAllChannels(Internal::SshChannelManager::CloseAllRegular);
} catch (const Botan::Exception &e) {
qDebug("%s: %s", Q_FUNC_INFO, e.what());
qCWarning(Internal::sshLog, "%s: %s", Q_FUNC_INFO, e.what());
return -1;
}
}
@@ -324,10 +325,7 @@ void SshConnectionPrivate::handleIncomingData()
if (!canUseSocket())
return;
m_incomingData += m_socket->readAll();
#ifdef CREATOR_SSH_DEBUG
qDebug("state = %d, remote data size = %d", m_state,
m_incomingData.count());
#endif
qCDebug(sshLog, "state = %d, remote data size = %d", m_state, m_incomingData.count());
if (m_serverId.isEmpty())
handleServerId();
handlePackets();
@@ -346,10 +344,8 @@ void SshConnectionPrivate::handleIncomingData()
// RFC 4253, 4.2.
void SshConnectionPrivate::handleServerId()
{
#ifdef CREATOR_SSH_DEBUG
qDebug("%s: incoming data size = %d, incoming data = '%s'",
qCDebug(sshLog, "%s: incoming data size = %d, incoming data = '%s'",
Q_FUNC_INFO, m_incomingData.count(), m_incomingData.data());
#endif
const int newLinePos = m_incomingData.indexOf('\n');
if (newLinePos == -1)
return; // Not enough data yet.