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

Unified Diff: chromeos/network/managed_network_configuration_handler_impl.cc

Issue 207183003: Cleanup network event logging, add to ManagedNetworkConfigurationHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 | chromeos/network/network_configuration_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/managed_network_configuration_handler_impl.cc
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
index 67ab01f8ebd6eee71199543365fa5f28edafadcb..f233147e2d720d7143361437edeee75c4465354b 100644
--- a/chromeos/network/managed_network_configuration_handler_impl.cc
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -69,7 +69,10 @@ void InvokeErrorCallback(const std::string& service_path,
void LogErrorWithDict(const tracked_objects::Location& from_where,
const std::string& error_name,
scoped_ptr<base::DictionaryValue> error_data) {
- LOG(ERROR) << from_where.ToString() << ": " << error_name;
+ network_event_log::internal::AddEntry(
+ from_where.file_name(), from_where.line_number(),
+ network_event_log::LOG_LEVEL_ERROR,
+ error_name, "");
}
const base::DictionaryValue* GetByGUID(const GuidToPolicyMap& policies,
@@ -143,10 +146,8 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedPropertiesCallback(
&profile_path);
const NetworkProfile* profile =
network_profile_handler_->GetProfileForPath(profile_path);
- if (!profile) {
- LOG(ERROR) << "No or no known profile received for service "
- << service_path << ".";
- }
+ if (!profile)
+ NET_LOG_ERROR("No profile for service: " + profile_path, service_path);
scoped_ptr<NetworkUIData> ui_data =
shill_property_util::GetUIDataFromProperties(shill_properties);
@@ -162,8 +163,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedPropertiesCallback(
else
NOTREACHED();
} else if (profile) {
- LOG(WARNING) << "Service " << service_path << " of profile "
- << profile_path << " contains no or no valid UIData.";
+ NET_LOG_ERROR("Service contains empty or invalid UIData", service_path);
// TODO(pneubeck): add a conversion of user configured entries of old
// ChromeOS versions. We will have to use a heuristic to determine which
// properties _might_ be user configured.
@@ -377,9 +377,8 @@ void ManagedNetworkConfigurationHandlerImpl::SetPolicy(
DCHECK(!guid.empty());
if (policies->per_network_config.count(guid) > 0) {
- LOG(ERROR) << "ONC from " << ToDebugString(onc_source, userhash)
- << " contains several entries for the same GUID "
- << guid << ".";
+ NET_LOG_ERROR("ONC from " + ToDebugString(onc_source, userhash) +
+ " contains several entries for the same GUID ", guid);
delete policies->per_network_config[guid];
}
const base::DictionaryValue* new_entry = network->DeepCopy();
@@ -461,7 +460,9 @@ void ManagedNetworkConfigurationHandlerImpl::
existing_properties.GetStringWithoutPathExpansion(shill::kProfileProperty,
&profile);
if (profile.empty()) {
- LOG(ERROR) << "Missing profile property.";
+ NET_LOG_ERROR("Missing profile property",
+ shill_property_util::GetNetworkIdFromProperties(
+ existing_properties));
return;
}
shill_properties.SetStringWithoutPathExpansion(shill::kProfileProperty,
@@ -469,7 +470,9 @@ void ManagedNetworkConfigurationHandlerImpl::
if (!shill_property_util::CopyIdentifyingProperties(existing_properties,
&shill_properties)) {
- LOG(ERROR) << "Missing identifying properties.";
+ NET_LOG_ERROR("Missing identifying properties",
+ shill_property_util::GetNetworkIdFromProperties(
+ existing_properties));
}
shill_properties.MergeDictionary(&new_properties);
@@ -536,7 +539,7 @@ ManagedNetworkConfigurationHandlerImpl::FindPolicyByGuidAndProfile(
const NetworkProfile* profile =
network_profile_handler_->GetProfileForPath(profile_path);
if (!profile) {
- LOG(ERROR) << "Profile path unknown: " << profile_path;
+ NET_LOG_ERROR("Profile path unknown:" + profile_path, guid);
return NULL;
}
« no previous file with comments | « no previous file | chromeos/network/network_configuration_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698