summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2019-11-19 13:36:05 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2019-11-19 13:58:45 (GMT)
commit261ba8d8595ed8cb90f9c4feb1d6ef642942bcba (patch)
treec7e60d473509db8c4dbff5aa83fbde963d8dd75e /Swiften/Disco/DiscoServiceWalker.cpp
parent697ae6ae84512a744958b24118197ec7bfdbc1f0 (diff)
downloadswift-261ba8d8595ed8cb90f9c4feb1d6ef642942bcba.zip
swift-261ba8d8595ed8cb90f9c4feb1d6ef642942bcba.tar.bz2
Remove std::endl from SWIFT_LOG calls
The std::endl is now added by ~Log, but only for output to stderr or a log file. Calls to the Android logging system or manually set callbacks will not include the newline in the logging output. JIRA: SWIFT-430 Test-Information: Unit tests pass on Debian 9 Checked that running Swift with logging to stderr still had a newline. Change-Id: I096fdba78a3b8f87db2097951c28c528592183e8
Diffstat (limited to 'Swiften/Disco/DiscoServiceWalker.cpp')
-rw-r--r--Swiften/Disco/DiscoServiceWalker.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Swiften/Disco/DiscoServiceWalker.cpp b/Swiften/Disco/DiscoServiceWalker.cpp
index a3f95d2..7332e63 100644
--- a/Swiften/Disco/DiscoServiceWalker.cpp
+++ b/Swiften/Disco/DiscoServiceWalker.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2016 Isode Limited. 2 * Copyright (c) 2010-2019 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -17,7 +17,7 @@ DiscoServiceWalker::DiscoServiceWalker(const JID& service, IQRouter* iqRouter, s
17} 17}
18 18
19void DiscoServiceWalker::beginWalk() { 19void DiscoServiceWalker::beginWalk() {
20 SWIFT_LOG(debug) << "Starting walk to " << service_ << std::endl; 20 SWIFT_LOG(debug) << "Starting walk to " << service_;
21 assert(!active_); 21 assert(!active_);
22 assert(servicesBeingSearched_.empty()); 22 assert(servicesBeingSearched_.empty());
23 active_ = true; 23 active_ = true;
@@ -26,7 +26,7 @@ void DiscoServiceWalker::beginWalk() {
26 26
27void DiscoServiceWalker::endWalk() { 27void DiscoServiceWalker::endWalk() {
28 if (active_) { 28 if (active_) {
29 SWIFT_LOG(debug) << "Ending walk to " << service_ << std::endl; 29 SWIFT_LOG(debug) << "Ending walk to " << service_;
30 for (auto&& request : pendingDiscoInfoRequests_) { 30 for (auto&& request : pendingDiscoInfoRequests_) {
31 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoInfoResponse, this, _1, _2, request)); 31 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoInfoResponse, this, _1, _2, request));
32 } 32 }
@@ -39,7 +39,7 @@ void DiscoServiceWalker::endWalk() {
39} 39}
40 40
41void DiscoServiceWalker::walkNode(const JID& jid) { 41void DiscoServiceWalker::walkNode(const JID& jid) {
42 SWIFT_LOG(debug) << "Walking node " << jid << std::endl; 42 SWIFT_LOG(debug) << "Walking node " << jid;
43 servicesBeingSearched_.insert(jid); 43 servicesBeingSearched_.insert(jid);
44 searchedServices_.insert(jid); 44 searchedServices_.insert(jid);
45 GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(jid, iqRouter_); 45 GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(jid, iqRouter_);
@@ -54,7 +54,7 @@ void DiscoServiceWalker::handleDiscoInfoResponse(std::shared_ptr<DiscoInfo> info
54 return; 54 return;
55 } 55 }
56 56
57 SWIFT_LOG(debug) << "Disco info response from " << request->getReceiver() << std::endl; 57 SWIFT_LOG(debug) << "Disco info response from " << request->getReceiver();
58 58
59 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoInfoResponse, this, _1, _2, request)); 59 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoInfoResponse, this, _1, _2, request));
60 pendingDiscoInfoRequests_.erase(request); 60 pendingDiscoInfoRequests_.erase(request);
@@ -90,7 +90,7 @@ void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr<DiscoItems> it
90 return; 90 return;
91 } 91 }
92 92
93 SWIFT_LOG(debug) << "Received disco items from " << request->getReceiver() << std::endl; 93 SWIFT_LOG(debug) << "Received disco items from " << request->getReceiver();
94 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoItemsResponse, this, _1, _2, request)); 94 request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoItemsResponse, this, _1, _2, request));
95 pendingDiscoItemsRequests_.erase(request); 95 pendingDiscoItemsRequests_.erase(request);
96 if (error) { 96 if (error) {
@@ -103,7 +103,7 @@ void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr<DiscoItems> it
103 * but I've never seen one in the wild, and it's an easy fix for not looping. 103 * but I've never seen one in the wild, and it's an easy fix for not looping.
104 */ 104 */
105 if (std::find(searchedServices_.begin(), searchedServices_.end(), item.getJID()) == searchedServices_.end()) { /* Don't recurse infinitely */ 105 if (std::find(searchedServices_.begin(), searchedServices_.end(), item.getJID()) == searchedServices_.end()) { /* Don't recurse infinitely */
106 SWIFT_LOG(debug) << "Received disco item " << item.getJID() << std::endl; 106 SWIFT_LOG(debug) << "Received disco item " << item.getJID();
107 walkNode(item.getJID()); 107 walkNode(item.getJID());
108 } 108 }
109 } 109 }
@@ -112,12 +112,12 @@ void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr<DiscoItems> it
112} 112}
113 113
114void DiscoServiceWalker::handleDiscoError(const JID& jid, ErrorPayload::ref /*error*/) { 114void DiscoServiceWalker::handleDiscoError(const JID& jid, ErrorPayload::ref /*error*/) {
115 SWIFT_LOG(debug) << "Disco error from " << jid << std::endl; 115 SWIFT_LOG(debug) << "Disco error from " << jid;
116 markNodeCompleted(jid); 116 markNodeCompleted(jid);
117} 117}
118 118
119void DiscoServiceWalker::markNodeCompleted(const JID& jid) { 119void DiscoServiceWalker::markNodeCompleted(const JID& jid) {
120 SWIFT_LOG(debug) << "Node completed " << jid << std::endl; 120 SWIFT_LOG(debug) << "Node completed " << jid;
121 servicesBeingSearched_.erase(jid); 121 servicesBeingSearched_.erase(jid);
122 /* All results are in */ 122 /* All results are in */
123 if (servicesBeingSearched_.empty()) { 123 if (servicesBeingSearched_.empty()) {