Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: components/cryptauth/cryptauth_device_manager.cc

Issue 2928733004: CryptAuth: Improve logging around device syncing to display a human-readable device name. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cryptauth/cryptauth_device_manager.cc
diff --git a/components/cryptauth/cryptauth_device_manager.cc b/components/cryptauth/cryptauth_device_manager.cc
index 3c7a3cf578973dbb848966e0bb18f3c698103934..1c811e309a7df4a4bf0631b0df71bab4488351ec 100644
--- a/components/cryptauth/cryptauth_device_manager.cc
+++ b/components/cryptauth/cryptauth_device_manager.cc
@@ -419,10 +419,20 @@ 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());
+
+ PA_LOG(INFO) << "Devices were successfully synced.";
Kyle Horimoto 2017/06/08 20:43:03 nit: Only print if !responses.devices().empty().
Ryan Hansberry 2017/06/08 22:13:59 Done.
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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698