diff options
| author | Edwin Mons <edwin.mons@isode.com> | 2019-11-19 13:36:05 (GMT) |
|---|---|---|
| committer | Edwin Mons <edwin.mons@isode.com> | 2019-11-19 13:58:45 (GMT) |
| commit | 261ba8d8595ed8cb90f9c4feb1d6ef642942bcba (patch) | |
| tree | c7e60d473509db8c4dbff5aa83fbde963d8dd75e /Swiften/Client | |
| parent | 697ae6ae84512a744958b24118197ec7bfdbc1f0 (diff) | |
| download | swift-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/Client')
| -rw-r--r-- | Swiften/Client/ClientSession.cpp | 8 | ||||
| -rw-r--r-- | Swiften/Client/ClientSessionStanzaChannel.cpp | 4 | ||||
| -rw-r--r-- | Swiften/Client/CoreClient.cpp | 32 |
3 files changed, 22 insertions, 22 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index 4e34417..1114336 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp @@ -1,8 +1,8 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2019 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Client/ClientSession.h> @@ -85,13 +85,13 @@ ClientSession::ClientSession( authenticator(nullptr), certificateTrustChecker(nullptr), singleSignOn(false), authenticationPort(-1) { #ifdef SWIFTEN_PLATFORM_WIN32 if (WindowsRegistry::isFIPSEnabled()) { - SWIFT_LOG(info) << "Windows is running in FIPS-140 mode. Some authentication methods will be unavailable." << std::endl; + SWIFT_LOG(info) << "Windows is running in FIPS-140 mode. Some authentication methods will be unavailable."; } #endif } ClientSession::~ClientSession() { } @@ -528,26 +528,26 @@ void ClientSession::handleStreamShutdownTimeout() { void ClientSession::finish() { if (state != State::Finishing && state != State::Finished) { finishSession(std::shared_ptr<Error>()); } else { - SWIFT_LOG(warning) << "Session already finished or finishing." << std::endl; + SWIFT_LOG(warning) << "Session already finished or finishing."; } } void ClientSession::finishSession(Error::Type error) { finishSession(std::make_shared<Swift::ClientSession::Error>(error)); } void ClientSession::finishSession(std::shared_ptr<Swift::Error> error) { if (!error_) { error_ = error; } else { - SWIFT_LOG(warning) << "Session finished twice" << std::endl; + SWIFT_LOG(warning) << "Session finished twice"; } assert(stream->isOpen()); if (stanzaAckResponder_) { stanzaAckResponder_->handleAckRequestReceived(); } if (authenticator) { diff --git a/Swiften/Client/ClientSessionStanzaChannel.cpp b/Swiften/Client/ClientSessionStanzaChannel.cpp index f48b306..6a5d07d 100644 --- a/Swiften/Client/ClientSessionStanzaChannel.cpp +++ b/Swiften/Client/ClientSessionStanzaChannel.cpp @@ -1,8 +1,8 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2019 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Client/ClientSessionStanzaChannel.h> @@ -46,13 +46,13 @@ void ClientSessionStanzaChannel::sendPresence(std::shared_ptr<Presence> presence std::string ClientSessionStanzaChannel::getNewIQID() { return idGenerator.generateID(); } void ClientSessionStanzaChannel::send(std::shared_ptr<Stanza> stanza) { if (!isAvailable()) { - SWIFT_LOG(warning) << "Client: Trying to send a stanza while disconnected." << std::endl; + SWIFT_LOG(warning) << "Client: Trying to send a stanza while disconnected."; return; } session->sendStanza(stanza); } void ClientSessionStanzaChannel::handleSessionFinished(std::shared_ptr<Error>) { diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp index ccde0c2..7579bca 100644 --- a/Swiften/Client/CoreClient.cpp +++ b/Swiften/Client/CoreClient.cpp @@ -1,8 +1,8 @@ /* - * Copyright (c) 2010-2018 Isode Limited. + * Copyright (c) 2010-2019 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Client/CoreClient.h> @@ -66,59 +66,59 @@ void CoreClient::connect(const ClientOptions& o) { assert(proxyConnectionFactories.empty()); bool useDirectConnection = true; HostAddressPort systemSOCKS5Proxy = networkFactories->getProxyProvider()->getSOCKS5Proxy(); HostAddressPort systemHTTPConnectProxy = networkFactories->getProxyProvider()->getHTTPConnectProxy(); switch (o.proxyType) { case ClientOptions::NoProxy: - SWIFT_LOG(debug) << " without a proxy" << std::endl; + SWIFT_LOG(debug) << " without a proxy"; break; case ClientOptions::SystemConfiguredProxy: - SWIFT_LOG(debug) << " with a system configured proxy" << std::endl; + SWIFT_LOG(debug) << " with a system configured proxy"; if (systemSOCKS5Proxy.isValid()) { - SWIFT_LOG(debug) << "Found SOCK5 Proxy: " << systemSOCKS5Proxy.getAddress().toString() << ":" << systemSOCKS5Proxy.getPort() << std::endl; + SWIFT_LOG(debug) << "Found SOCK5 Proxy: " << systemSOCKS5Proxy.getAddress().toString() << ":" << systemSOCKS5Proxy.getPort(); proxyConnectionFactories.push_back(new SOCKS5ProxiedConnectionFactory(networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory(), systemSOCKS5Proxy.getAddress().toString(), systemSOCKS5Proxy.getPort())); } if (systemHTTPConnectProxy.isValid()) { - SWIFT_LOG(debug) << "Found HTTPConnect Proxy: " << systemHTTPConnectProxy.getAddress().toString() << ":" << systemHTTPConnectProxy.getPort() << std::endl; + SWIFT_LOG(debug) << "Found HTTPConnect Proxy: " << systemHTTPConnectProxy.getAddress().toString() << ":" << systemHTTPConnectProxy.getPort(); proxyConnectionFactories.push_back(new HTTPConnectProxiedConnectionFactory(networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory(), systemHTTPConnectProxy.getAddress().toString(), systemHTTPConnectProxy.getPort())); } break; case ClientOptions::SOCKS5Proxy: { - SWIFT_LOG(debug) << " with manual configured SOCKS5 proxy" << std::endl; + SWIFT_LOG(debug) << " with manual configured SOCKS5 proxy"; std::string proxyHostname = o.manualProxyHostname.empty() ? systemSOCKS5Proxy.getAddress().toString() : o.manualProxyHostname; auto proxyPort = systemSOCKS5Proxy.getPort(); if (o.manualProxyPort != -1) { try { proxyPort = boost::numeric_cast<unsigned short>(o.manualProxyPort); } catch (const boost::numeric::bad_numeric_cast& e) { - SWIFT_LOG(warning) << "Manual proxy port " << o.manualProxyPort << " is invalid: " << e.what() << std::endl; + SWIFT_LOG(warning) << "Manual proxy port " << o.manualProxyPort << " is invalid: " << e.what(); onDisconnected(boost::optional<ClientError>(ClientError::ConnectionError)); return; } } - SWIFT_LOG(debug) << "Proxy: " << proxyHostname << ":" << proxyPort << std::endl; + SWIFT_LOG(debug) << "Proxy: " << proxyHostname << ":" << proxyPort; proxyConnectionFactories.push_back(new SOCKS5ProxiedConnectionFactory(networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory(), proxyHostname, proxyPort)); useDirectConnection = false; break; } case ClientOptions::HTTPConnectProxy: { - SWIFT_LOG(debug) << " with manual configured HTTPConnect proxy" << std::endl; + SWIFT_LOG(debug) << " with manual configured HTTPConnect proxy"; std::string proxyHostname = o.manualProxyHostname.empty() ? systemHTTPConnectProxy.getAddress().toString() : o.manualProxyHostname; unsigned short proxyPort = systemHTTPConnectProxy.getPort(); if (o.manualProxyPort != -1) { try { proxyPort = boost::numeric_cast<unsigned short>(o.manualProxyPort); } catch (const boost::numeric::bad_numeric_cast& e) { - SWIFT_LOG(warning) << "Manual proxy port " << o.manualProxyPort << " is invalid: " << e.what() << std::endl; + SWIFT_LOG(warning) << "Manual proxy port " << o.manualProxyPort << " is invalid: " << e.what(); onDisconnected(boost::optional<ClientError>(ClientError::ConnectionError)); return; } } - SWIFT_LOG(debug) << "Proxy: " << proxyHostname << ":" << proxyPort << std::endl; + SWIFT_LOG(debug) << "Proxy: " << proxyHostname << ":" << proxyPort; proxyConnectionFactories.push_back(new HTTPConnectProxiedConnectionFactory(networkFactories->getDomainNameResolver(), networkFactories->getConnectionFactory(), networkFactories->getTimerFactory(), proxyHostname, proxyPort, o.httpTrafficFilter)); useDirectConnection = false; break; } } std::vector<ConnectionFactory*> connectionFactories(proxyConnectionFactories); @@ -131,13 +131,13 @@ void CoreClient::connect(const ClientOptions& o) { unsigned short port = 0; if (o.manualPort != -1) { try { port = boost::numeric_cast<unsigned short>(o.manualPort); } catch (const boost::numeric::bad_numeric_cast& e) { - SWIFT_LOG(warning) << "Invalid manual port " << o.manualPort << ": " << e.what() << std::endl; + SWIFT_LOG(warning) << "Invalid manual port " << o.manualPort << ": " << e.what(); onDisconnected(boost::optional<ClientError>(ClientError::ConnectionError)); return; } } boost::optional<std::string> serviceLookupPrefix; if (o.manualHostname.empty()) { @@ -171,13 +171,13 @@ void CoreClient::connect(const ClientOptions& o) { options.tlsOptions, options.httpTrafficFilter)); sessionStream_ = boshSessionStream_; sessionStream_->onDataRead.connect(boost::bind(&CoreClient::handleDataRead, this, _1)); sessionStream_->onDataWritten.connect(boost::bind(&CoreClient::handleDataWritten, this, _1)); if (certificate_ && !certificate_->isNull()) { - SWIFT_LOG(debug) << "set certificate" << std::endl; + SWIFT_LOG(debug) << "set certificate"; sessionStream_->setTLSCertificate(certificate_); } boshSessionStream_->open(); bindSessionToStream(); } @@ -420,13 +420,13 @@ void CoreClient::sendMessage(std::shared_ptr<Message> message) { void CoreClient::sendPresence(std::shared_ptr<Presence> presence) { stanzaChannel_->sendPresence(presence); } void CoreClient::sendData(const std::string& data) { if (!sessionStream_) { - SWIFT_LOG(warning) << "Client: Trying to send data while disconnected." << std::endl; + SWIFT_LOG(warning) << "Client: Trying to send data while disconnected."; return; } sessionStream_->writeData(data); } bool CoreClient::isActive() const { @@ -504,16 +504,16 @@ void CoreClient::resetSession() { sessionStream_.reset(); connection_.reset(); } void CoreClient::forceReset() { if (connector_) { - SWIFT_LOG(warning) << "Client not disconnected properly: Connector still active" << std::endl; + SWIFT_LOG(warning) << "Client not disconnected properly: Connector still active"; resetConnector(); } if (sessionStream_ || connection_) { - SWIFT_LOG(warning) << "Client not disconnected properly: Session still active" << std::endl; + SWIFT_LOG(warning) << "Client not disconnected properly: Session still active"; resetSession(); } } } |
Swift