diff --git a/sharing/advertisement.cc b/sharing/advertisement.cc index 2f3029c9..34458086 100644 --- a/sharing/advertisement.cc +++ b/sharing/advertisement.cc @@ -127,25 +127,25 @@ std::unique_ptr Advertisement::NewInstance( ShareTargetType device_type, std::optional device_name, uint8_t vendor_id) { if (salt.size() != Advertisement::kSaltSize) { - NL_LOG(ERROR) << "Failed to create advertisement because the salt did " - "not match the expected length " - << salt.size(); + LOG(ERROR) << "Failed to create advertisement because the salt did " + "not match the expected length " + << salt.size(); return nullptr; } if (encrypted_metadata_key.size() != Advertisement::kMetadataEncryptionKeyHashByteSize) { - NL_LOG(ERROR) << "Failed to create advertisement because the encrypted " - "metadata key did " - "not match the expected length " - << encrypted_metadata_key.size(); + LOG(ERROR) << "Failed to create advertisement because the encrypted " + "metadata key did " + "not match the expected length " + << encrypted_metadata_key.size(); return nullptr; } if (device_name.has_value() && device_name->size() > UINT8_MAX) { - NL_LOG(ERROR) << "Failed to create advertisement because device name " - "was over UINT8_MAX: " - << device_name->size(); + LOG(ERROR) << "Failed to create advertisement because device name " + "was over UINT8_MAX: " + << device_name->size(); return nullptr; } @@ -199,7 +199,7 @@ std::unique_ptr Advertisement::FromEndpointInfo( // name. // LINT.IfChange if (endpoint_info.size() < kMinimumSize) { - NL_LOG(ERROR) << "Failed to parse advertisement because it was too short."; + LOG(ERROR) << "Failed to parse advertisement because it was too short."; return nullptr; } @@ -208,9 +208,8 @@ std::unique_ptr Advertisement::FromEndpointInfo( int version = ParseVersion(first_byte); if (version < 0 || version > kMaxSupportedAdvertisementParsedVersionNumber) { - NL_LOG(ERROR) - << "Failed to parse advertisement; unsupported version number " - << version; + LOG(ERROR) << "Failed to parse advertisement; unsupported version number " + << version; return nullptr; } @@ -231,10 +230,9 @@ std::unique_ptr Advertisement::FromEndpointInfo( if (device_name_length == 0 || (endpoint_info.end() - iter < device_name_length)) { - NL_LOG(ERROR) - << "Failed to parse advertisement because the device name did " - "not match the expected length " - << device_name_length; + LOG(ERROR) << "Failed to parse advertisement because the device name did " + "not match the expected length " + << device_name_length; return nullptr; } @@ -248,24 +246,24 @@ std::unique_ptr Advertisement::FromEndpointInfo( TlvTypes type = static_cast(*iter++); uint8_t value_len = *iter++; if (endpoint_info.end() - iter < value_len) { - NL_LOG(ERROR) << "Invalid length when parsing TLV element: " << value_len; + LOG(ERROR) << "Invalid length when parsing TLV element: " << value_len; return nullptr; } switch (type) { case TlvTypes::kVendorId: if (value_len != kVendorIdLength) { - NL_LOG(ERROR) << "Invalid vendor_id_len: " << value_len; + LOG(ERROR) << "Invalid vendor_id_len: " << value_len; return nullptr; } vendor_id = ConvertVendorId(*iter++); break; case TlvTypes::kQrCode: - NL_LOG(INFO) << "Found QR code data, skipping."; + LOG(INFO) << "Found QR code data, skipping."; // TODO: b/341984671 - Implement handling for this TLV type. iter += value_len; break; default: - NL_LOG(ERROR) << "Unknown TLV type: " << static_cast(type); + LOG(ERROR) << "Unknown TLV type: " << static_cast(type); iter += value_len; break; } diff --git a/sharing/certificates/nearby_share_certificate_storage.cc b/sharing/certificates/nearby_share_certificate_storage.cc index f5fba1d9..837812ed 100644 --- a/sharing/certificates/nearby_share_certificate_storage.cc +++ b/sharing/certificates/nearby_share_certificate_storage.cc @@ -53,7 +53,7 @@ void NearbyShareCertificateStorage::UpdatePrivateCertificate( std::optional> certs = GetPrivateCertificates(); if (!certs) { - NL_LOG(WARNING) << __func__ << ": No private certificates to update."; + LOG(WARNING) << __func__ << ": No private certificates to update."; return; } @@ -63,12 +63,12 @@ void NearbyShareCertificateStorage::UpdatePrivateCertificate( return cert.id() == private_certificate.id(); }); if (it == certs->end()) { - NL_VLOG(1) << __func__ << ": No private certificate with id=" + VLOG(1) << __func__ << ": No private certificate with id=" << nearby::utils::HexEncode(private_certificate.id()); return; } - NL_VLOG(1) << __func__ << ": Updating private certificate id=" + VLOG(1) << __func__ << ": Updating private certificate id=" << nearby::utils::HexEncode(private_certificate.id()); *it = private_certificate; ReplacePrivateCertificates(*certs); @@ -92,13 +92,13 @@ void NearbyShareCertificateStorage::RemoveExpiredPrivateCertificates( size_t num_removed = certs->size() - unexpired_certs.size(); if (num_removed == 0) return; - NL_VLOG(1) << __func__ << ": Removing " << num_removed - << " expired private certificates."; + VLOG(1) << __func__ << ": Removing " << num_removed + << " expired private certificates."; ReplacePrivateCertificates(unexpired_certs); } void NearbyShareCertificateStorage::ClearPrivateCertificates() { - NL_VLOG(1) << __func__ << ": Removing all private certificates."; + VLOG(1) << __func__ << ": Removing all private certificates."; ReplacePrivateCertificates({}); } @@ -119,9 +119,8 @@ void NearbyShareCertificateStorage::ClearPrivateCertificatesOfVisibility( } if (were_certs_removed) { - NL_VLOG(1) << __func__ - << ": Removing all private certificates of visibility " - << static_cast(visibility); + VLOG(1) << __func__ << ": Removing all private certificates of visibility " + << static_cast(visibility); ReplacePrivateCertificates(new_certs); } } diff --git a/sharing/certificates/nearby_share_decrypted_public_certificate.cc b/sharing/certificates/nearby_share_decrypted_public_certificate.cc index 892c939b..02c8d9c5 100644 --- a/sharing/certificates/nearby_share_decrypted_public_certificate.cc +++ b/sharing/certificates/nearby_share_decrypted_public_certificate.cc @@ -62,7 +62,7 @@ std::optional> DecryptMetadataKey( std::unique_ptr encryptor = CreateNearbyShareCtrEncryptor(secret_key, encrypted_metadata_key.salt()); if (!encryptor) { - NL_LOG(ERROR) + LOG(ERROR) << "Cannot decrypt metadata key: Could not create CTR encryptor."; return std::nullopt; } @@ -172,16 +172,16 @@ NearbyShareDecryptedPublicCertificate::DecryptPublicCertificate( auto decrypted_metadata_bytes = DecryptMetadataPayload( encrypted_metadata, *decrypted_metadata_key, secret_key.get()); if (!decrypted_metadata_bytes) { - NL_LOG(ERROR) << "Metadata decryption failed: Failed to decrypt metadata" - << "payload."; + LOG(ERROR) << "Metadata decryption failed: Failed to decrypt metadata" + << "payload."; return std::nullopt; } nearby::sharing::proto::EncryptedMetadata unencrypted_metadata; if (!unencrypted_metadata.ParseFromArray(decrypted_metadata_bytes->data(), decrypted_metadata_bytes->size())) { - NL_LOG(ERROR) << "Metadata decryption failed: Failed to parse decrypted " - << "metadata payload."; + LOG(ERROR) << "Metadata decryption failed: Failed to parse decrypted " + << "metadata payload."; return std::nullopt; } @@ -242,7 +242,7 @@ bool NearbyShareDecryptedPublicCertificate::VerifySignature( crypto::SignatureVerifier verifier; if (!verifier.VerifyInit(crypto::SignatureVerifier::ECDSA_SHA256, signature, public_key_)) { - NL_LOG(ERROR) << "Verification failed: Initialization unsuccessful."; + LOG(ERROR) << "Verification failed: Initialization unsuccessful."; return false; } diff --git a/sharing/incoming_share_session.cc b/sharing/incoming_share_session.cc index 5c19ef79..6567cbb4 100644 --- a/sharing/incoming_share_session.cc +++ b/sharing/incoming_share_session.cc @@ -114,9 +114,8 @@ IncomingShareSession::ProcessIntroduction( for (const AppMetadata& apk : introduction_frame.app_metadata()) { if (apk.size() <= 0) { - NL_LOG(WARNING) - << __func__ - << ": Ignore introduction, due to invalid attachment size"; + LOG(WARNING) << __func__ + << ": Ignore introduction, due to invalid attachment size"; return TransferMetadata::Status::kUnsupportedAttachmentType; } @@ -125,9 +124,9 @@ IncomingShareSession::ProcessIntroduction( << ", package_name=" << apk.package_name() << ", size=" << apk.size(); if (std::numeric_limits::max() - apk.size() < file_size_sum) { - NL_LOG(WARNING) << __func__ - << ": Ignoring introduction, total file size overflowed " - "64 bit integer."; + LOG(WARNING) << __func__ + << ": Ignoring introduction, total file size overflowed " + "64 bit integer."; container.Clear(); return TransferMetadata::Status::kNotEnoughSpace; } diff --git a/sharing/internal/public/connectivity_manager_impl.cc b/sharing/internal/public/connectivity_manager_impl.cc index 9d0589ac..00f67091 100644 --- a/sharing/internal/public/connectivity_manager_impl.cc +++ b/sharing/internal/public/connectivity_manager_impl.cc @@ -68,8 +68,8 @@ ConnectivityManagerImpl::ConnectivityManagerImpl(SharingPlatform& platform) bool is_lan_connected) { ConnectionType new_connection_type = static_cast(connection_type); - NL_VLOG(1) << ": New connection type:" - << GetConnectionTypeString(new_connection_type); + VLOG(1) << ": New connection type:" + << GetConnectionTypeString(new_connection_type); for (auto& listener : listeners_) { listener.second(new_connection_type, is_lan_connected); } diff --git a/sharing/internal/public/logging.h b/sharing/internal/public/logging.h index ec31719e..f0b432bc 100644 --- a/sharing/internal/public/logging.h +++ b/sharing/internal/public/logging.h @@ -27,9 +27,4 @@ // IWYU pragma: end_exports #endif // defined(NEARBY_CHROMIUM) -// Public APIs -// The stream statement must come last, or it won't compile. -#define NL_VLOG(level) VLOG(level) -#define NL_LOG(severity) LOG(severity) - #endif // THIRD_PARTY_NEARBY_SHARING_INTERNAL_PUBLIC_LOGGING_H_ diff --git a/sharing/local_device_data/nearby_share_local_device_data_manager.cc b/sharing/local_device_data/nearby_share_local_device_data_manager.cc index 34cf22ae..843dc46c 100644 --- a/sharing/local_device_data/nearby_share_local_device_data_manager.cc +++ b/sharing/local_device_data/nearby_share_local_device_data_manager.cc @@ -58,11 +58,11 @@ void NearbyShareLocalDeviceDataManager::Stop() { void NearbyShareLocalDeviceDataManager::NotifyLocalDeviceDataChanged( bool did_device_name_change, bool did_full_name_change, bool did_icon_change) { - NL_LOG(INFO) << __func__ << ": did_device_name_change=" - << (did_device_name_change ? "true" : "false") - << ", did_full_name_change=" - << (did_full_name_change ? "true" : "false") - << ", did_icon_change=" << (did_icon_change ? "true" : "false"); + LOG(INFO) << __func__ << ": did_device_name_change=" + << (did_device_name_change ? "true" : "false") + << ", did_full_name_change=" + << (did_full_name_change ? "true" : "false") + << ", did_icon_change=" << (did_icon_change ? "true" : "false"); for (auto& observer : observers_.GetObservers()) { observer->OnLocalDeviceDataChanged(did_device_name_change, did_full_name_change, did_icon_change); diff --git a/sharing/nearby_connections_service.cc b/sharing/nearby_connections_service.cc index 0a1b3d6e..3bd58d31 100644 --- a/sharing/nearby_connections_service.cc +++ b/sharing/nearby_connections_service.cc @@ -45,8 +45,8 @@ Payload ConvertToPayload(NcPayload payload) { case NcPayloadType::kFile: { std::string file_path = payload.AsFile()->GetFilePath(); std::string parent_folder = payload.GetParentFolder(); - NL_VLOG(1) << __func__ << ": Payload file_path=" << file_path - << ", parent_folder = " << parent_folder; + VLOG(1) << __func__ << ": Payload file_path=" << file_path + << ", parent_folder = " << parent_folder; return Payload(payload.GetId(), InputFile(file_path), parent_folder); } default: @@ -64,8 +64,8 @@ NcPayload ConvertToServicePayload(Payload payload) { payload.content.file_payload.file.path.filename().u8string()); std::string parent_folder = payload.content.file_payload.parent_folder; std::replace(parent_folder.begin(), parent_folder.end(), '\\', '/'); - NL_VLOG(1) << __func__ << ": NC Payload file_path=" << file_path - << ", parent_folder = " << parent_folder; + VLOG(1) << __func__ << ": NC Payload file_path=" << file_path + << ", parent_folder = " << parent_folder; nearby::InputFile input_file(file_path, file_size); NcPayload nc_payload(payload.id, parent_folder, file_name, std::move(input_file)); diff --git a/sharing/nearby_file_handler.cc b/sharing/nearby_file_handler.cc index 14f7dafd..e8d1c2fb 100644 --- a/sharing/nearby_file_handler.cc +++ b/sharing/nearby_file_handler.cc @@ -45,8 +45,8 @@ std::vector DoOpenFiles( for (const auto& file_path : file_paths) { std::optional size = GetFileSize(file_path); if (!size.has_value()) { - NL_LOG(ERROR) << __func__ << ": Failed to open file. File=" - << GetCompatibleU8String(file_path.u8string()); + LOG(ERROR) << __func__ << ": Failed to open file. File=" + << GetCompatibleU8String(file_path.u8string()); return {}; } files.push_back({*size, file_path}); @@ -84,18 +84,18 @@ void NearbyFileHandler::DeleteFilesFromDisk( continue; } if (RemoveFile(file_path)) { - NL_VLOG(1) << __func__ << ": Removed partial file. File=" - << GetCompatibleU8String(file_path.u8string()); + VLOG(1) << __func__ << ": Removed partial file. File=" + << GetCompatibleU8String(file_path.u8string()); } else { // Try once more after 3 seconds. absl::SleepFor(absl::Seconds(3)); if (RemoveFile(file_path)) { - NL_VLOG(1) << __func__ - << ": Removed partial file after additional delay. File=" - << GetCompatibleU8String(file_path.u8string()); + VLOG(1) << __func__ + << ": Removed partial file after additional delay. File=" + << GetCompatibleU8String(file_path.u8string()); } else { - NL_LOG(ERROR) << __func__ << "Can't remove file: " - << GetCompatibleU8String(file_path.u8string()); + LOG(ERROR) << __func__ << "Can't remove file: " + << GetCompatibleU8String(file_path.u8string()); } } } diff --git a/sharing/nearby_sharing_service.cc b/sharing/nearby_sharing_service.cc index 12c4b1f7..4deaba53 100644 --- a/sharing/nearby_sharing_service.cc +++ b/sharing/nearby_sharing_service.cc @@ -48,8 +48,8 @@ std::string NearbySharingService::StatusCodeToString(StatusCodes status_code) { case StatusCodes::kInvalidArgument: return "kInvalidArgument"; } - NL_LOG(ERROR) << "Unexpected value for StatusCodes: " - << static_cast(status_code); + LOG(ERROR) << "Unexpected value for StatusCodes: " + << static_cast(status_code); return kUnknownStatusCodesString; } diff --git a/sharing/nearby_sharing_settings.cc b/sharing/nearby_sharing_settings.cc index 51ea522f..7525553c 100644 --- a/sharing/nearby_sharing_settings.cc +++ b/sharing/nearby_sharing_settings.cc @@ -89,7 +89,7 @@ NearbyShareSettings::NearbyShareSettings( std::weak_ptr(is_desctructing_)](absl::string_view key) { std::shared_ptr is_desctructing = desctructing.lock(); if (is_desctructing == nullptr || *is_desctructing) { - NL_LOG(WARNING) << ": Ignore the preferences change callback."; + LOG(WARNING) << ": Ignore the preferences change callback."; return; } @@ -140,12 +140,12 @@ DataUsage NearbyShareSettings::GetDataUsage() const { void NearbyShareSettings::StartVisibilityTimer( absl::Duration expiration) { - NL_LOG(INFO) << __func__ - << ": start visibility timer. expiration=" << expiration; + LOG(INFO) << __func__ + << ": start visibility timer. expiration=" << expiration; visibility_expiration_timer_ = std::make_unique( *context_->GetTaskRunner(), "nearby_share_settings_visibility_timer", expiration, [this]() { - NL_LOG(INFO) << __func__ << ": visibility timer expired."; + LOG(INFO) << __func__ << ": visibility timer expired."; proto::DeviceVisibility visibility; { absl::MutexLock lock(&mutex_); @@ -167,18 +167,18 @@ void NearbyShareSettings::RestoreFallbackVisibility() { int64_t now_seconds = absl::ToUnixSeconds(clock_->Now()); int64_t remaining_seconds = expiration_seconds - now_seconds; int64_t diff = kMaxVisibilityExpirationSeconds - remaining_seconds; - NL_LOG(INFO) << __func__ << ": diff=" << diff << ", now=" << now_seconds - << ", expiration=" << expiration_seconds - << ", max=" << kMaxVisibilityExpirationSeconds; + LOG(INFO) << __func__ << ": diff=" << diff << ", now=" << now_seconds + << ", expiration=" << expiration_seconds + << ", max=" << kMaxVisibilityExpirationSeconds; if (remaining_seconds > 0 && remaining_seconds <= kMaxVisibilityExpirationSeconds) { // Not expired StartVisibilityTimer(absl::Seconds(remaining_seconds)); } else if (expiration_seconds != 0) { // Expired. - NL_LOG(INFO) << __func__ - << ": timer is already expired. Restore fallback visibility."; + LOG(INFO) << __func__ + << ": timer is already expired. Restore fallback visibility."; SetVisibility(static_cast(fallback_visibility)); } else { - NL_LOG(INFO) << __func__ << ": No running fallback Visibility."; + LOG(INFO) << __func__ << ": No running fallback Visibility."; } } @@ -270,15 +270,15 @@ void NearbyShareSettings::SetVisibility(DeviceVisibility visibility, last_visibility, visibility, absl::ToInt64Milliseconds(expiration)); } - NL_VLOG(1) << __func__ - << ": set visibility. visibility=" << static_cast(visibility) - << ", expiration=" << expiration; + VLOG(1) << __func__ + << ": set visibility. visibility=" << static_cast(visibility) + << ", expiration=" << expiration; visibility_expiration_timer_.reset(); SetFallbackVisibility(last_visibility); absl::Time now = clock_->Now(); if (expiration != absl::ZeroDuration()) { - NL_VLOG(1) << __func__ << ": temporary visibility timer starts."; + VLOG(1) << __func__ << ": temporary visibility timer starts."; absl::Time fallback_visibility_timestamp = now + expiration; preference_manager_.SetInteger( prefs::kNearbySharingBackgroundVisibilityExpirationSeconds, @@ -326,17 +326,17 @@ NearbyShareSettings::GetFallbackVisibility() const { visibility_expiration_timer_->IsRunning()) { result = GetRawFallbackVisibility(); } - NL_VLOG(1) << __func__ << ": get fallback visibility " - << static_cast(result.visibility) - << " expiration: " << result.fallback_time; + VLOG(1) << __func__ << ": get fallback visibility " + << static_cast(result.visibility) + << " expiration: " << result.fallback_time; return result; } void NearbyShareSettings::SetFallbackVisibility(DeviceVisibility visibility) { - NL_VLOG(1) << __func__ << ": set fallback visibility. visibility=" - << static_cast(visibility); + VLOG(1) << __func__ << ": set fallback visibility. visibility=" + << static_cast(visibility); if (visibility == DeviceVisibility::DEVICE_VISIBILITY_EVERYONE) { - NL_VLOG(1) << __func__ << ": visibility is everyone. Skip."; + VLOG(1) << __func__ << ": visibility is everyone. Skip."; return; } diff --git a/sharing/nearby_sharing_settings.h b/sharing/nearby_sharing_settings.h index 9a17fc19..7105977b 100644 --- a/sharing/nearby_sharing_settings.h +++ b/sharing/nearby_sharing_settings.h @@ -113,7 +113,7 @@ class NearbyShareSettings } break; default: - NL_LOG(FATAL) << "Invalid tag: " << this->tag; + LOG(FATAL) << "Invalid tag: " << this->tag; break; } return result; diff --git a/sharing/nearby_sharing_util.cc b/sharing/nearby_sharing_util.cc index 49aba148..550370f6 100644 --- a/sharing/nearby_sharing_util.cc +++ b/sharing/nearby_sharing_util.cc @@ -77,17 +77,17 @@ std::string PowerLevelToString(PowerLevel level) { std::optional> GetBluetoothMacAddressFromCertificate( const NearbyShareDecryptedPublicCertificate& certificate) { if (!certificate.unencrypted_metadata().has_bluetooth_mac_address()) { - NL_LOG(WARNING) << __func__ << ": Public certificate " - << nearby::utils::HexEncode(certificate.id()) - << " did not contain a Bluetooth mac address."; + LOG(WARNING) << __func__ << ": Public certificate " + << nearby::utils::HexEncode(certificate.id()) + << " did not contain a Bluetooth mac address."; return std::nullopt; } std::string mac_address = certificate.unencrypted_metadata().bluetooth_mac_address(); if (mac_address.size() != 6) { - NL_LOG(ERROR) << __func__ << ": Invalid bluetooth mac address: '" - << mac_address << "'"; + LOG(ERROR) << __func__ << ": Invalid bluetooth mac address: '" + << mac_address << "'"; return std::nullopt; } diff --git a/sharing/thread_timer.cc b/sharing/thread_timer.cc index dfae6f98..c5df05d6 100644 --- a/sharing/thread_timer.cc +++ b/sharing/thread_timer.cc @@ -39,11 +39,11 @@ ThreadTimer::ThreadTimer(TaskRunner& task_runner, std::string name, name = name_]() mutable { if (run_cnt->fetch_add(1) == 0) { // Timer has not been cancelled, run the task. - NL_LOG(INFO) << "Timer " << name << " fired."; + LOG(INFO) << "Timer " << name << " fired."; std::move(task)(); } else { // Timer has been cancelled, need to delete the run_cnt. - NL_VLOG(1) << "Timer " << name << " expired but was cancelled."; + VLOG(1) << "Timer " << name << " expired but was cancelled."; delete run_cnt; } })) { @@ -57,7 +57,7 @@ ThreadTimer::~ThreadTimer() { Cancel(); } void ThreadTimer::Cancel() { if (run_cnt_ != nullptr) { - NL_LOG(INFO) << "Timer " << name_ << " cancelled."; + LOG(INFO) << "Timer " << name_ << " cancelled."; if (run_cnt_->fetch_add(1) > 0) { // Timer has already fired, delete the run_cnt. delete run_cnt_; diff --git a/sharing/transfer_manager.cc b/sharing/transfer_manager.cc index a00b9cdd..ab2c00cd 100644 --- a/sharing/transfer_manager.cc +++ b/sharing/transfer_manager.cc @@ -57,7 +57,7 @@ void TransferManager::Send(std::function task) { absl::MutexLock lock(&mutex_); if (is_waiting_for_high_quality_medium_) { - NL_LOG(INFO) + LOG(INFO) << "Connection to endpoint " << endpoint_id_ << " is waiting for a high quality medium, delaying payload transfer."; pending_tasks_.push_back(task); @@ -71,19 +71,19 @@ void TransferManager::OnMediumQualityChanged(Medium current_medium) { absl::MutexLock lock(&mutex_); if (!is_waiting_for_high_quality_medium_) { - NL_LOG(WARNING) << "It is not waiting for high quality medium."; + LOG(WARNING) << "It is not waiting for high quality medium."; return; } if (!IsHighQualityMedium(current_medium)) { - NL_LOG(WARNING) << "medium switched to low quality Medium: " - << static_cast(current_medium); + LOG(WARNING) << "medium switched to low quality Medium: " + << static_cast(current_medium); return; } - NL_LOG(INFO) << "Connection to endpoint " << endpoint_id_ - << " has changed to a high quality medium: " - << static_cast(current_medium); + LOG(INFO) << "Connection to endpoint " << endpoint_id_ + << " has changed to a high quality medium: " + << static_cast(current_medium); StopWaitingForHighQualityMedium(); } @@ -91,12 +91,12 @@ bool TransferManager::StartTransfer() { absl::MutexLock lock(&mutex_); if (!is_waiting_for_high_quality_medium_) { - NL_LOG(WARNING) << "No need to wait for high quality medium."; + LOG(WARNING) << "No need to wait for high quality medium."; return false; } if (timeout_timer_ != nullptr) { - NL_LOG(WARNING) << "transfer already started."; + LOG(WARNING) << "transfer already started."; return false; } @@ -105,16 +105,16 @@ bool TransferManager::StartTransfer() { kMediumUpgradeTimeout, [this]() { absl::MutexLock lock(&mutex_); - NL_LOG(INFO) << "Timed out for endpoint " << endpoint_id_ << " after " - << kMediumUpgradeTimeout; + LOG(INFO) << "Timed out for endpoint " << endpoint_id_ << " after " + << kMediumUpgradeTimeout; StopWaitingForHighQualityMedium(); }); - NL_LOG(INFO) << "Attempting to upgrade the bandwidth for endpoint " + - endpoint_id_ + ". Large payloads will be delayed" + - " until either bandwidth is upgraded or a timeout of " - << (kMediumUpgradeTimeout / absl::Milliseconds(1)) - << " milliseconds is reached"; + LOG(INFO) << "Attempting to upgrade the bandwidth for endpoint " + + endpoint_id_ + ". Large payloads will be delayed" + + " until either bandwidth is upgraded or a timeout of " + << (kMediumUpgradeTimeout / absl::Milliseconds(1)) + << " milliseconds is reached"; return true; } @@ -122,12 +122,12 @@ bool TransferManager::CancelTransfer() { absl::MutexLock lock(&mutex_); if (timeout_timer_ == nullptr) { - NL_LOG(WARNING) << "No running transfer."; + LOG(WARNING) << "No running transfer."; return false; } timeout_timer_.reset(); - NL_LOG(INFO) << __func__ << "Transfer is canceled"; + LOG(INFO) << __func__ << "Transfer is canceled"; return true; } @@ -135,7 +135,7 @@ void TransferManager::StopWaitingForHighQualityMedium() { is_waiting_for_high_quality_medium_ = false; for (const auto& task : pending_tasks_) { - NL_LOG(INFO) << "Sending delayed payload to endpoint " << endpoint_id_; + LOG(INFO) << "Sending delayed payload to endpoint " << endpoint_id_; task(); } diff --git a/sharing/wrapped_share_target_discovered_callback.cc b/sharing/wrapped_share_target_discovered_callback.cc index 4a98539e..0db23635 100644 --- a/sharing/wrapped_share_target_discovered_callback.cc +++ b/sharing/wrapped_share_target_discovered_callback.cc @@ -32,8 +32,8 @@ bool WrappedShareTargetDiscoveredCallback::ShouldBlockShareTarget( void WrappedShareTargetDiscoveredCallback::OnShareTargetDiscovered( const ShareTarget& share_target) { if (ShouldBlockShareTarget(share_target)) { - NL_LOG(INFO) << "Skipping share target discovered for vendor id " - << static_cast(blocked_vendor_id_); + LOG(INFO) << "Skipping share target discovered for vendor id " + << static_cast(blocked_vendor_id_); return; } if (callback_ != nullptr) { @@ -44,8 +44,8 @@ void WrappedShareTargetDiscoveredCallback::OnShareTargetDiscovered( void WrappedShareTargetDiscoveredCallback::OnShareTargetUpdated( const ShareTarget& share_target) { if (ShouldBlockShareTarget(share_target)) { - NL_LOG(INFO) << "Skipping share target updated for vendor id " - << static_cast(blocked_vendor_id_); + LOG(INFO) << "Skipping share target updated for vendor id " + << static_cast(blocked_vendor_id_); return; } if (callback_ != nullptr) { @@ -56,8 +56,8 @@ void WrappedShareTargetDiscoveredCallback::OnShareTargetUpdated( void WrappedShareTargetDiscoveredCallback::OnShareTargetLost( const ShareTarget& share_target) { if (ShouldBlockShareTarget(share_target)) { - NL_LOG(INFO) << "Skipping share target lost for vendor id " - << static_cast(blocked_vendor_id_); + LOG(INFO) << "Skipping share target lost for vendor id " + << static_cast(blocked_vendor_id_); return; } if (callback_ != nullptr) {