aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/ssh/sftpchannel.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2016-01-14 17:11:03 +0100
committerChristian Kandeler <[email protected]>2016-01-18 12:17:15 +0000
commitb72c3cba2451881aca5cfb4989f08114da4f615f (patch)
tree86b4ce6d869cd3aa1319299087c9cab114bfa193 /src/libs/ssh/sftpchannel.cpp
parent54d64971d8047d9fd6655fa53634bc1df9b63466 (diff)
SSH: Use categorized logging.
Change-Id: I9890c7d4a86320c835e70e66c523c5a2f7b41421 Reviewed-by: Michal Klocek <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'src/libs/ssh/sftpchannel.cpp')
-rw-r--r--src/libs/ssh/sftpchannel.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/libs/ssh/sftpchannel.cpp b/src/libs/ssh/sftpchannel.cpp
index f68e4277025..cf5811cf5a9 100644
--- a/src/libs/ssh/sftpchannel.cpp
+++ b/src/libs/ssh/sftpchannel.cpp
@@ -33,6 +33,7 @@
#include "sshexception_p.h"
#include "sshincomingpacket_p.h"
+#include "sshlogging_p.h"
#include "sshsendfacility_p.h"
#include <QDir>
@@ -256,9 +257,7 @@ void SftpChannelPrivate::handleChannelSuccess()
{
if (channelState() == CloseRequested)
return;
-#ifdef CREATOR_SSH_DEBUG
- qDebug("sftp subsystem initialized");
-#endif
+ qCDebug(sshLog, "sftp subsystem initialized");
sendData(m_outgoingPacket.generateInit(ProtocolVersion).rawData());
m_sftpState = InitSent;
}
@@ -293,15 +292,13 @@ void SftpChannelPrivate::handleChannelDataInternal(const QByteArray &data)
void SftpChannelPrivate::handleChannelExtendedDataInternal(quint32 type,
const QByteArray &data)
{
- qWarning("Unexpected extended data '%s' of type %d on SFTP channel.",
- data.data(), type);
+ qCWarning(sshLog, "Unexpected extended data '%s' of type %d on SFTP channel.",
+ data.data(), type);
}
void SftpChannelPrivate::handleExitStatus(const SshChannelExitStatus &exitStatus)
{
-#ifdef CREATOR_SSH_DEBUG
- qDebug("Remote SFTP service exited with exit code %d", exitStatus.exitStatus);
-#endif
+ qCDebug(sshLog, "Remote SFTP service exited with exit code %d", exitStatus.exitStatus);
if (channelState() == CloseRequested || channelState() == Closed)
return;
@@ -322,9 +319,7 @@ void SftpChannelPrivate::handleExitSignal(const SshChannelExitSignal &signal)
void SftpChannelPrivate::handleCurrentPacket()
{
-#ifdef CREATOR_SSH_DEBUG
- qDebug("Handling SFTP packet of type %d", m_incomingPacket.type());
-#endif
+ qCDebug(sshLog, "Handling SFTP packet of type %d", m_incomingPacket.type());
switch (m_incomingPacket.type()) {
case SSH_FXP_VERSION:
handleServerVersion();
@@ -359,9 +354,7 @@ void SftpChannelPrivate::handleServerVersion()
"Unexpected SSH_FXP_VERSION packet.");
}
-#ifdef CREATOR_SSH_DEBUG
- qDebug("sftp init received");
-#endif
+ qCDebug(sshLog, "sftp init received");
const quint32 serverVersion = m_incomingPacket.extractServerVersion();
if (serverVersion != ProtocolVersion) {
emit channelError(tr("Protocol version mismatch: Expected %1, got %2")
@@ -450,9 +443,7 @@ void SftpChannelPrivate::handlePutHandle(const JobMap::Iterator &it)
void SftpChannelPrivate::handleStatus()
{
const SftpStatusResponse &response = m_incomingPacket.asStatusResponse();
-#ifdef CREATOR_SSH_DEBUG
- qDebug("%s: status = %d", Q_FUNC_INFO, response.status);
-#endif
+ qCDebug(sshLog, "%s: status = %d", Q_FUNC_INFO, response.status);
JobMap::Iterator it = lookupJob(response.requestId);
switch (it.value()->type()) {
case AbstractSftpOperation::ListDir:
@@ -850,9 +841,7 @@ void SftpChannelPrivate::closeHook()
void SftpChannelPrivate::handleOpenSuccessInternal()
{
-#ifdef CREATOR_SSH_DEBUG
- qDebug("SFTP session started");
-#endif
+ qCDebug(sshLog, "SFTP session started");
m_sendFacility.sendSftpPacket(remoteChannel());
m_sftpState = SubsystemRequested;
}