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/TLS/CAPICertificate.cpp | |
| 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/TLS/CAPICertificate.cpp')
| -rw-r--r-- | Swiften/TLS/CAPICertificate.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/TLS/CAPICertificate.cpp b/Swiften/TLS/CAPICertificate.cpp index f10ad47..526b535 100644 --- a/Swiften/TLS/CAPICertificate.cpp +++ b/Swiften/TLS/CAPICertificate.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2012-2016 Isode Limited. | 2 | * Copyright (c) 2012-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 | */ |
| @@ -22,7 +22,7 @@ | |||
| 22 | #define DEBUG_SCARD_STATUS(function, status) \ | 22 | #define DEBUG_SCARD_STATUS(function, status) \ |
| 23 | { \ | 23 | { \ |
| 24 | std::shared_ptr<boost::system::error_code> errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \ | 24 | std::shared_ptr<boost::system::error_code> errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \ |
| 25 | SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message() << std::endl; \ | 25 | SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message(); \ |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | namespace Swift { | 28 | namespace Swift { |
| @@ -44,7 +44,7 @@ CAPICertificate::CAPICertificate(const std::string& capiUri, TimerFactory* timer | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | CAPICertificate::~CAPICertificate() { | 46 | CAPICertificate::~CAPICertificate() { |
| 47 | SWIFT_LOG(debug) << "Destroying the CAPICertificate" << std::endl; | 47 | SWIFT_LOG(debug) << "Destroying the CAPICertificate"; |
| 48 | if (smartCardTimer_) { | 48 | if (smartCardTimer_) { |
| 49 | smartCardTimer_->stop(); | 49 | smartCardTimer_->stop(); |
| 50 | smartCardTimer_->onTick.disconnect(boost::bind(&CAPICertificate::handleSmartCardTimerTick, this)); | 50 | smartCardTimer_->onTick.disconnect(boost::bind(&CAPICertificate::handleSmartCardTimerTick, this)); |
| @@ -53,7 +53,7 @@ CAPICertificate::~CAPICertificate() { | |||
| 53 | 53 | ||
| 54 | if (certStoreHandle_) { | 54 | if (certStoreHandle_) { |
| 55 | if (CertCloseStore(certStoreHandle_, 0) == FALSE) { | 55 | if (CertCloseStore(certStoreHandle_, 0) == FALSE) { |
| 56 | SWIFT_LOG(debug) << "Failed to close the certificate store handle" << std::endl; | 56 | SWIFT_LOG(debug) << "Failed to close the certificate store handle"; |
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -161,7 +161,7 @@ void CAPICertificate::setUri(const std::string& capiUri) { | |||
| 161 | CERT_KEY_PROV_INFO_PROP_ID, | 161 | CERT_KEY_PROV_INFO_PROP_ID, |
| 162 | NULL, | 162 | NULL, |
| 163 | &len)) { | 163 | &len)) { |
| 164 | SWIFT_LOG(error) << "Error while retrieving context properties" << std::endl; | 164 | SWIFT_LOG(error) << "Error while retrieving context properties"; |
| 165 | return; | 165 | return; |
| 166 | } | 166 | } |
| 167 | 167 | ||
| @@ -287,25 +287,25 @@ bool CAPICertificate::checkIfSmartCardPresent() { | |||
| 287 | 287 | ||
| 288 | switch (dwState) { | 288 | switch (dwState) { |
| 289 | case SCARD_ABSENT: | 289 | case SCARD_ABSENT: |
| 290 | SWIFT_LOG(debug) << "Card absent." << std::endl; | 290 | SWIFT_LOG(debug) << "Card absent."; |
| 291 | break; | 291 | break; |
| 292 | case SCARD_PRESENT: | 292 | case SCARD_PRESENT: |
| 293 | SWIFT_LOG(debug) << "Card present." << std::endl; | 293 | SWIFT_LOG(debug) << "Card present."; |
| 294 | break; | 294 | break; |
| 295 | case SCARD_SWALLOWED: | 295 | case SCARD_SWALLOWED: |
| 296 | SWIFT_LOG(debug) << "Card swallowed." << std::endl; | 296 | SWIFT_LOG(debug) << "Card swallowed."; |
| 297 | break; | 297 | break; |
| 298 | case SCARD_POWERED: | 298 | case SCARD_POWERED: |
| 299 | SWIFT_LOG(debug) << "Card has power." << std::endl; | 299 | SWIFT_LOG(debug) << "Card has power."; |
| 300 | break; | 300 | break; |
| 301 | case SCARD_NEGOTIABLE: | 301 | case SCARD_NEGOTIABLE: |
| 302 | SWIFT_LOG(debug) << "Card reset and waiting PTS negotiation." << std::endl; | 302 | SWIFT_LOG(debug) << "Card reset and waiting PTS negotiation."; |
| 303 | break; | 303 | break; |
| 304 | case SCARD_SPECIFIC: | 304 | case SCARD_SPECIFIC: |
| 305 | SWIFT_LOG(debug) << "Card has specific communication protocols set." << std::endl; | 305 | SWIFT_LOG(debug) << "Card has specific communication protocols set."; |
| 306 | break; | 306 | break; |
| 307 | default: | 307 | default: |
| 308 | SWIFT_LOG(debug) << "Unknown or unexpected card state." << std::endl; | 308 | SWIFT_LOG(debug) << "Unknown or unexpected card state."; |
| 309 | break; | 309 | break; |
| 310 | } | 310 | } |
| 311 | 311 | ||
| @@ -332,7 +332,7 @@ bool CAPICertificate::checkIfSmartCardPresent() { | |||
| 332 | void CAPICertificate::handleSmartCardTimerTick() { | 332 | void CAPICertificate::handleSmartCardTimerTick() { |
| 333 | bool poll = checkIfSmartCardPresent(); | 333 | bool poll = checkIfSmartCardPresent(); |
| 334 | if (lastPollingResult_ && !poll) { | 334 | if (lastPollingResult_ && !poll) { |
| 335 | SWIFT_LOG(debug) << "CAPI Certificate detected that the certificate card was removed" << std::endl; | 335 | SWIFT_LOG(debug) << "CAPI Certificate detected that the certificate card was removed"; |
| 336 | onCertificateCardRemoved(); | 336 | onCertificateCardRemoved(); |
| 337 | } | 337 | } |
| 338 | lastPollingResult_ = poll; | 338 | lastPollingResult_ = poll; |
Swift