diff --git a/cpp/core/internal/mediums/ble.cc b/cpp/core/internal/mediums/ble.cc index ad334623..6085928f 100644 --- a/cpp/core/internal/mediums/ble.cc +++ b/cpp/core/internal/mediums/ble.cc @@ -23,6 +23,7 @@ #include "platform/base/prng.h" #include "platform/public/logging.h" #include "platform/public/mutex_lock.h" +#include "absl/strings/escaping.h" namespace location { namespace nearby { @@ -106,10 +107,10 @@ bool Ble::StartAdvertising(const std::string& service_id, if (!medium_.StartAdvertising(service_id, medium_advertisement_bytes, fast_advertisement_service_uuid)) { - NEARBY_LOGS(INFO) + NEARBY_LOGS(ERROR) << "Failed to turn on BLE advertising with advertisement bytes=" - << advertisement_bytes.data() << "(" << advertisement_bytes.size() - << ")" + << absl::BytesToHexString(advertisement_bytes.data()) + << ", size=" << advertisement_bytes.size() << ", fast advertisement service uuid=" << fast_advertisement_service_uuid; return false; diff --git a/cpp/core/internal/p2p_cluster_pcp_handler.cc b/cpp/core/internal/p2p_cluster_pcp_handler.cc index 096b443a..847f617d 100644 --- a/cpp/core/internal/p2p_cluster_pcp_handler.cc +++ b/cpp/core/internal/p2p_cluster_pcp_handler.cc @@ -1051,9 +1051,10 @@ proto::connections::Medium P2pClusterPcpHandler::StartBleAdvertising( if (!ble_medium_.StartAdvertising(service_id, advertisement_bytes, options.fast_advertisement_service_uuid)) { - NEARBY_LOGS(INFO) << "P2pClusterPcpHandler::StartBleAdvertising: failed to " - "start advertising, advertisement_bytes=%p" - << advertisement_bytes.data(); + NEARBY_LOGS(ERROR) + << "P2pClusterPcpHandler::StartBleAdvertising: failed to " + "start advertising, advertisement_bytes=" + << absl::BytesToHexString(advertisement_bytes.data()); ble_medium_.StopAcceptingConnections(service_id); return proto::connections::UNKNOWN_MEDIUM; }