summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavol Babincak <scroolik@gmail.com>2012-04-23 22:09:01 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-04-24 18:04:58 (GMT)
commitfd990d0154feb63e00b7506b63530376a8bc9f01 (patch)
treed815d8541105374f6320c48aeac52cf0af6e8baa /Swift/Controllers
parent5cf6ef99404a08c0e9d2ed4f6df79375fda11d4a (diff)
downloadswift-contrib-fd990d0154feb63e00b7506b63530376a8bc9f01.zip
swift-contrib-fd990d0154feb63e00b7506b63530376a8bc9f01.tar.bz2
Debug messages print only if logging is enabled
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/ChatController.cpp8
-rw-r--r--Swift/Controllers/FileTransfer/FileTransferController.cpp5
2 files changed, 7 insertions, 6 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index 5602dcd..4352c8b 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -248,7 +248,7 @@ void ChatController::handleNewFileTransferController(FileTransferController* ftc
}
void ChatController::handleFileTransferCancel(std::string id) {
- std::cout << "handleFileTransferCancel(" << id << ")" << std::endl;
+ SWIFT_LOG(debug) << "handleFileTransferCancel(" << id << ")" << std::endl;
if (ftControllers.find(id) != ftControllers.end()) {
ftControllers[id]->cancel();
} else {
@@ -257,7 +257,7 @@ void ChatController::handleFileTransferCancel(std::string id) {
}
void ChatController::handleFileTransferStart(std::string id, std::string description) {
- std::cout << "handleFileTransferStart(" << id << ", " << description << ")" << std::endl;
+ SWIFT_LOG(debug) << "handleFileTransferStart(" << id << ", " << description << ")" << std::endl;
if (ftControllers.find(id) != ftControllers.end()) {
ftControllers[id]->start(description);
} else {
@@ -266,7 +266,7 @@ void ChatController::handleFileTransferStart(std::string id, std::string descrip
}
void ChatController::handleFileTransferAccept(std::string id, std::string filename) {
- std::cout << "handleFileTransferAccept(" << id << ", " << filename << ")" << std::endl;
+ SWIFT_LOG(debug) "handleFileTransferAccept(" << id << ", " << filename << ")" << std::endl;
if (ftControllers.find(id) != ftControllers.end()) {
ftControllers[id]->accept(filename);
} else {
@@ -275,7 +275,7 @@ void ChatController::handleFileTransferAccept(std::string id, std::string filena
}
void ChatController::handleSendFileRequest(std::string filename) {
- std::cout << "ChatController::handleSendFileRequest(" << filename << ")" << std::endl;
+ SWIFT_LOG(debug) << "ChatController::handleSendFileRequest(" << filename << ")" << std::endl;
eventStream_->send(boost::make_shared<SendFileUIEvent>(getToJID(), filename));
}
diff --git a/Swift/Controllers/FileTransfer/FileTransferController.cpp b/Swift/Controllers/FileTransfer/FileTransferController.cpp
index afa907d..f1fd19e 100644
--- a/Swift/Controllers/FileTransfer/FileTransferController.cpp
+++ b/Swift/Controllers/FileTransfer/FileTransferController.cpp
@@ -11,6 +11,7 @@
#include <Swiften/Base/boost_bsignals.h>
#include <boost/bind.hpp>
#include "Swift/Controllers/UIInterfaces/ChatWindow.h"
+#include <Swiften/Base/Log.h>
#include <boost/smart_ptr/make_shared.hpp>
@@ -69,7 +70,7 @@ boost::uintmax_t FileTransferController::getSize() const {
}
void FileTransferController::start(std::string& description) {
- std::cout << "FileTransferController::start" << std::endl;
+ SWIFT_LOG("DEBUG") << "FileTransferController::start" << std::endl;
fileReadStream = boost::make_shared<FileReadBytestream>(boost::filesystem::path(filename));
OutgoingFileTransfer::ref outgoingTransfer = ftManager->createOutgoingFileTransfer(otherParty, boost::filesystem::path(filename), description, fileReadStream);
if (outgoingTransfer) {
@@ -85,7 +86,7 @@ void FileTransferController::start(std::string& description) {
}
void FileTransferController::accept(std::string& file) {
- std::cout << "FileTransferController::accept" << std::endl;
+ SWIFT_LOG("DEBUG") << "FileTransferController::accept" << std::endl;
IncomingFileTransfer::ref incomingTransfer = boost::dynamic_pointer_cast<IncomingFileTransfer>(transfer);
if (incomingTransfer) {
fileWriteStream = boost::make_shared<FileWriteBytestream>(boost::filesystem::path(file));