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/Network/Connector.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/Network/Connector.cpp')
-rw-r--r--Swiften/Network/Connector.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp
index a0e6b23..e27b95d 100644
--- a/Swiften/Network/Connector.cpp
+++ b/Swiften/Network/Connector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2018 Isode Limited.
+ * Copyright (c) 2010-2019 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -25,7 +25,7 @@ void Connector::setTimeoutMilliseconds(int milliseconds) {
}
void Connector::start() {
- SWIFT_LOG(debug) << "Starting connector for " << hostname << std::endl;
+ SWIFT_LOG(debug) << "Starting connector for " << hostname;
assert(!currentConnection);
assert(!serviceQuery);
assert(!timer);
@@ -66,7 +66,7 @@ void Connector::queryAddress(const std::string& hostname) {
}
void Connector::handleServiceQueryResult(const std::vector<DomainNameServiceQuery::Result>& result) {
- SWIFT_LOG(debug) << result.size() << " SRV result(s)" << std::endl;
+ SWIFT_LOG(debug) << result.size() << " SRV result(s)";
serviceQueryResults = std::deque<DomainNameServiceQuery::Result>(result.begin(), result.end());
serviceQuery.reset();
if (!serviceQueryResults.empty()) {
@@ -77,23 +77,23 @@ void Connector::handleServiceQueryResult(const std::vector<DomainNameServiceQuer
void Connector::tryNextServiceOrFallback() {
if (queriedAllServices) {
- SWIFT_LOG(debug) << "Queried all services" << std::endl;
+ SWIFT_LOG(debug) << "Queried all services";
finish(std::shared_ptr<Connection>());
}
else if (serviceQueryResults.empty()) {
- SWIFT_LOG(debug) << "Falling back on A resolution" << std::endl;
+ SWIFT_LOG(debug) << "Falling back on A resolution";
// Fall back on simple address resolving
queriedAllServices = true;
queryAddress(hostname);
}
else {
- SWIFT_LOG(debug) << "Querying next address" << std::endl;
+ SWIFT_LOG(debug) << "Querying next address";
queryAddress(serviceQueryResults.front().hostname);
}
}
void Connector::handleAddressQueryResult(const std::vector<HostAddress>& addresses, boost::optional<DomainNameResolveError> error) {
- SWIFT_LOG(debug) << addresses.size() << " addresses" << std::endl;
+ SWIFT_LOG(debug) << addresses.size() << " addresses";
addressQuery.reset();
if (error || addresses.empty()) {
if (!serviceQueryResults.empty()) {
@@ -110,7 +110,7 @@ void Connector::handleAddressQueryResult(const std::vector<HostAddress>& address
void Connector::tryNextAddress() {
if (addressQueryResults.empty()) {
- SWIFT_LOG(debug) << "Done trying addresses. Moving on." << std::endl;
+ SWIFT_LOG(debug) << "Done trying addresses. Moving on.";
// Done trying all addresses. Move on to the next host.
if (!serviceQueryResults.empty()) {
serviceQueryResults.pop_front();
@@ -118,7 +118,7 @@ void Connector::tryNextAddress() {
tryNextServiceOrFallback();
}
else {
- SWIFT_LOG(debug) << "Trying next address" << std::endl;
+ SWIFT_LOG(debug) << "Trying next address";
HostAddress address = addressQueryResults.front();
addressQueryResults.pop_front();
@@ -133,7 +133,7 @@ void Connector::tryNextAddress() {
void Connector::tryConnect(const HostAddressPort& target) {
assert(!currentConnection);
- SWIFT_LOG(debug) << "Trying to connect to " << target.getAddress().toString() << ":" << target.getPort() << std::endl;
+ SWIFT_LOG(debug) << "Trying to connect to " << target.getAddress().toString() << ":" << target.getPort();
currentConnection = connectionFactory->createConnection();
currentConnection->onConnectFinished.connect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1));
currentConnection->connect(target);
@@ -143,7 +143,7 @@ void Connector::tryConnect(const HostAddressPort& target) {
}
void Connector::handleConnectionConnectFinished(bool error) {
- SWIFT_LOG(debug) << "ConnectFinished: " << (error ? "error" : "success") << std::endl;
+ SWIFT_LOG(debug) << "ConnectFinished: " << (error ? "error" : "success");
if (timer) {
timer->stop();
timer.reset();
@@ -195,8 +195,8 @@ void Connector::finish(std::shared_ptr<Connection> connection) {
}
void Connector::handleTimeout() {
- SWIFT_LOG(debug) << "Timeout" << std::endl;
- SWIFT_LOG_ASSERT(currentConnection, error) << "Connection not valid but triggered a timeout" <<std::endl;
+ SWIFT_LOG(debug) << "Timeout";
+ SWIFT_LOG_ASSERT(currentConnection, error) << "Connection not valid but triggered a timeout";
handleConnectionConnectFinished(true);
}