summaryrefslogtreecommitdiffstats
path: root/chromeos/network/shill_property_util.cc
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-24 16:57:21 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-24 16:57:21 +0000
commit14f98c8a71615c9780106f8c3589c4fb7cce60a3 (patch)
treeadd382f23177a612f1cf50263b90b9b50c045456 /chromeos/network/shill_property_util.cc
parentb8ce11d5f59e40a124e6b943c12c1bfc01d3fbbc (diff)
downloadchromium_src-14f98c8a71615c9780106f8c3589c4fb7cce60a3.zip
chromium_src-14f98c8a71615c9780106f8c3589c4fb7cce60a3.tar.gz
chromium_src-14f98c8a71615c9780106f8c3589c4fb7cce60a3.tar.bz2
Cleanup network event logging, add to ManagedNetworkConfigurationHandler
I noticed we were getting some ERROR spam when we request properites for networks that are no longer visible, which required some additiona logging to track down (and hopefully make it easier to track down other issues in the future). BUG=none R=pneubeck@chromium.org Review URL: https://codereview.chromium.org/207183003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/shill_property_util.cc')
-rw-r--r--chromeos/network/shill_property_util.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/chromeos/network/shill_property_util.cc b/chromeos/network/shill_property_util.cc
index 613478e..35e4bb1 100644
--- a/chromeos/network/shill_property_util.cc
+++ b/chromeos/network/shill_property_util.cc
@@ -120,6 +120,22 @@ std::string GetSSIDFromProperties(const base::DictionaryValue& properties,
return ssid;
}
+std::string GetNetworkIdFromProperties(
+ const base::DictionaryValue& properties) {
+ if (properties.empty())
+ return "EmptyProperties";
+ std::string result;
+ if (properties.GetStringWithoutPathExpansion(shill::kGuidProperty, &result))
+ return result;
+ if (properties.GetStringWithoutPathExpansion(shill::kSSIDProperty, &result))
+ return result;
+ if (properties.GetStringWithoutPathExpansion(shill::kNameProperty, &result))
+ return result;
+ std::string type = "UnknownType";
+ properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type);
+ return "Unidentified " + type;
+}
+
std::string GetNameFromProperties(const std::string& service_path,
const base::DictionaryValue& properties) {
std::string name;
@@ -135,6 +151,10 @@ std::string GetNameFromProperties(const std::string& service_path,
std::string type;
properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type);
+ if (type.empty()) {
+ NET_LOG_ERROR("GetNameFromProperties: No type", service_path);
+ return validated_name;
+ }
if (!NetworkTypePattern::WiFi().MatchesType(type))
return validated_name;
@@ -222,8 +242,9 @@ bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties,
// with the keys "Provider.Type" and "Provider.Host".
const base::DictionaryValue* provider_properties = NULL;
if (!service_properties.GetDictionaryWithoutPathExpansion(
- shill::kProviderProperty, &provider_properties)) {
- NET_LOG_ERROR("CopyIdentifyingProperties", "Missing VPN provider dict");
+ shill::kProviderProperty, &provider_properties)) {
+ NET_LOG_ERROR("Missing VPN provider dict",
+ GetNetworkIdFromProperties(service_properties));
return false;
}
std::string vpn_provider_type;
@@ -246,8 +267,10 @@ bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties,
NOTREACHED() << "Unsupported network type " << type;
success = false;
}
- if (!success)
- NET_LOG_ERROR("CopyIdentifyingProperties", "Missing required properties");
+ if (!success) {
+ NET_LOG_ERROR("Missing required properties",
+ GetNetworkIdFromProperties(service_properties));
+ }
return success;
}