Commit 6d116f3f authored by hansberry's avatar hansberry Committed by Commit Bot

CryptAuth: Improve logging around device syncing to display a human-readable device name.

BUG=

Review-Url: https://codereview.chromium.org/2928733004
Cr-Commit-Position: refs/heads/master@{#478356}
parent 7d3b44d7
......@@ -419,10 +419,22 @@ void CryptAuthDeviceManager::OnGetMyDevicesSuccess(
const GetMyDevicesResponse& response) {
// Update the synced devices stored in the user's prefs.
std::unique_ptr<base::ListValue> devices_as_list(new base::ListValue());
if (!response.devices().empty())
PA_LOG(INFO) << "Devices were successfully synced.";
for (const auto& device : response.devices()) {
devices_as_list->Append(UnlockKeyToDictionary(device));
std::unique_ptr<base::DictionaryValue> device_dictionary =
UnlockKeyToDictionary(device);
const std::string& device_name = device.has_friendly_device_name()
? device.friendly_device_name()
: "[unknown]";
PA_LOG(INFO) << "Synced device '" << device_name
<< "': " << *device_dictionary;
devices_as_list->Append(std::move(device_dictionary));
}
PA_LOG(INFO) << "Devices Synced:\n" << *devices_as_list;
bool unlock_keys_changed = !devices_as_list->Equals(
pref_service_->GetList(prefs::kCryptAuthDeviceSyncUnlockKeys));
......
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