From c7496f1e9dc3f6666bdd8736ebc700331dcd520a Mon Sep 17 00:00:00 2001 From: Yuwei Huang Date: Fri, 31 May 2019 23:56:28 +0000 Subject: [PATCH] [remoting] Reduce HeartbeatSender log verbosity Previously HeartbeatSender logs a bunch of stuff like sequence ID and signature, which are not very useful now and spams the log. This CL reduces the verbosity of the log to just log JID and FTL ID. Bug: 969199 Change-Id: Id32e1aaab611793a0943eb359bec7439343d45d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1639365 Commit-Queue: Yuwei Huang Auto-Submit: Yuwei Huang Reviewed-by: Jamie Walch Cr-Commit-Position: refs/heads/master@{#665352} --- remoting/host/heartbeat_sender.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index 6e17980f07bce4..af17473d2a4e6e 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc @@ -105,17 +105,14 @@ HeartbeatSender::HeartbeatClient::~HeartbeatClient() = default; void HeartbeatSender::HeartbeatClient::Heartbeat( const apis::v1::HeartbeatRequest& request, HeartbeatResponseCallback callback) { - HOST_LOG << "Sending outgoing heartbeat:\n" - << "signature: " << request.signature() << "\n" - << "host_id: " << request.host_id() << "\n" - << "jabber_id: " << request.jabber_id() << "\n" - << "tachyon_id: " << request.tachyon_id() << "\n" - << "sequence_id: " << request.sequence_id() << "\n" - << "host_version: " << request.host_version() << "\n" - << "host_offline_reason: " << request.host_offline_reason() << "\n" - << "host_os_name: " << request.host_os_name() << "\n" - << "host_os_version: " << request.host_os_version() << "\n" - << "========================================================="; + std::string host_offline_reason_or_empty_log = + request.has_host_offline_reason() + ? (", host_offline_reason: " + request.host_offline_reason()) + : ""; + HOST_LOG << "Sending outgoing heartbeat." + << " jabber_id: " << request.jabber_id() + << ", tachyon_id: " << request.tachyon_id() + << host_offline_reason_or_empty_log; auto client_context = std::make_unique(); auto async_request = CreateGrpcAsyncUnaryRequest(