Commit 05d77a1f authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS MultiDevice] Update HostBackendDelegateImpl logs.

Previously, a log was only printed when the call to set/remove the host
failed, but it was hard to tell if/when the call actually succeeded.
This CL adds a log for this case.

Bug: 824568
Change-Id: I1328460f141faea4f69bb11243403c04d02c86fd
Reviewed-on: https://chromium-review.googlesource.com/1145832Reviewed-by: default avatarJeremy Klein <jlklein@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577361}
parent 72107012
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chromeos/services/multidevice_setup/host_backend_delegate_impl.h" #include "chromeos/services/multidevice_setup/host_backend_delegate_impl.h"
#include <algorithm> #include <algorithm>
#include <sstream>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
...@@ -298,16 +299,23 @@ void HostBackendDelegateImpl::OnSetSoftwareFeatureStateResult( ...@@ -298,16 +299,23 @@ void HostBackendDelegateImpl::OnSetSoftwareFeatureStateResult(
cryptauth::RemoteDeviceRef device_for_request, cryptauth::RemoteDeviceRef device_for_request,
bool attempted_to_enable, bool attempted_to_enable,
device_sync::mojom::NetworkRequestResult result_code) { device_sync::mojom::NetworkRequestResult result_code) {
if (result_code == device_sync::mojom::NetworkRequestResult::kSuccess) bool success =
result_code == device_sync::mojom::NetworkRequestResult::kSuccess;
std::stringstream ss;
ss << "HostBackendDelegateImpl::OnSetSoftwareFeatureStateResult(): "
<< (success ? "Completed successful" : "Failure requesting") << " "
<< "host change. Device ID: "
<< device_for_request.GetTruncatedDeviceIdForLogs()
<< ", Attempted to enable: " << (attempted_to_enable ? "true" : "false");
if (success) {
PA_LOG(INFO) << ss.str();
return; return;
}
PA_LOG(WARNING) << "HostBackendDelegateImpl::" ss << ", Error code: " << result_code;
<< "OnSetSoftwareFeatureStateResult(): Failure requesting " PA_LOG(WARNING) << ss.str();
<< "a host change. Device ID: "
<< device_for_request.GetTruncatedDeviceIdForLogs()
<< ", Attempted to enable: "
<< (attempted_to_enable ? "true" : "false")
<< ", Error code: " << result_code;
if (!HasPendingHostRequest()) if (!HasPendingHostRequest())
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment