From 468be3186c6db8c9d143d295d1c391075fa5d339 Mon Sep 17 00:00:00 2001 From: hai007 Date: Fri, 12 Feb 2021 12:27:38 -0800 Subject: [PATCH] cl/357028940 Do not log raw binary data. --- cpp/core/internal/base_pcp_handler.cc | 2 +- cpp/core/internal/mediums/ble.cc | 3 +-- cpp/core/internal/p2p_cluster_pcp_handler.cc | 10 ++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cpp/core/internal/base_pcp_handler.cc b/cpp/core/internal/base_pcp_handler.cc index 3bebcb01..63702034 100644 --- a/cpp/core/internal/base_pcp_handler.cc +++ b/cpp/core/internal/base_pcp_handler.cc @@ -90,7 +90,7 @@ Status BasePcpHandler::StartAdvertising(ClientProxy* client, response.Set({Status::kSuccess}); }); return WaitForResult( - absl::StrCat("StartAdvertising(", std::string(info.endpoint_info), ")"), + absl::StrCat("StartAdvertising(", service_id, ")"), client->GetClientId(), &response); } diff --git a/cpp/core/internal/mediums/ble.cc b/cpp/core/internal/mediums/ble.cc index d4cd2543..8b5bb0d5 100644 --- a/cpp/core/internal/mediums/ble.cc +++ b/cpp/core/internal/mediums/ble.cc @@ -69,8 +69,7 @@ bool Ble::StartAdvertising(const std::string& service_id, return false; } - NEARBY_LOGS(INFO) << "Turning on BLE advertising with advertisement bytes=" - << advertisement_bytes.data() << "(" + NEARBY_LOGS(INFO) << "Turning on BLE advertising (advertisement size=" << advertisement_bytes.size() << ")" << ", service id=" << service_id << ", fast advertisement service uuid=" diff --git a/cpp/core/internal/p2p_cluster_pcp_handler.cc b/cpp/core/internal/p2p_cluster_pcp_handler.cc index 2f7e32bd..03f06d0e 100644 --- a/cpp/core/internal/p2p_cluster_pcp_handler.cc +++ b/cpp/core/internal/p2p_cluster_pcp_handler.cc @@ -1000,10 +1000,8 @@ proto::connections::Medium P2pClusterPcpHandler::StartBleAdvertising( } NEARBY_LOG(INFO, - "P2pClusterPcpHandler::StartBleAdvertising: service=%s: " - "make advertisement; id=%s, name=%s", - service_id.c_str(), local_endpoint_id.c_str(), - std::string(local_endpoint_info).c_str()); + "P2pClusterPcpHandler::StartBleAdvertising: service=%s, id=%s", + service_id.c_str(), local_endpoint_id.c_str()); // Generate a BleAdvertisement. If a fast advertisement service UUID was // provided, create a fast BleAdvertisement. ByteArray advertisement_bytes; @@ -1031,10 +1029,6 @@ proto::connections::Medium P2pClusterPcpHandler::StartBleAdvertising( "BleAdvertisement failed"); ble_medium_.StopAcceptingConnections(service_id); return proto::connections::UNKNOWN_MEDIUM; - } else { - NEARBY_LOGS(INFO) << "P2pClusterPcpHandler::StartBleAdvertising: generate " - "BleAdvertisement succeeded; advertisement_bytes=" - << advertisement_bytes.data(); } NEARBY_LOG(