Commit 3c320550 authored by stevenjb@chromium.org's avatar stevenjb@chromium.org

Improve logging of Devices and Technologies

BUG=none

Review URL: https://codereview.chromium.org/288923005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271807 0039d316-1c4b-4281-b951-d872f2087c98
parent 5efb527a
...@@ -245,6 +245,9 @@ void FakeShillDeviceClient::AddDevice(const std::string& device_path, ...@@ -245,6 +245,9 @@ void FakeShillDeviceClient::AddDevice(const std::string& device_path,
base::DictionaryValue* properties = GetDeviceProperties(device_path); base::DictionaryValue* properties = GetDeviceProperties(device_path);
properties->SetWithoutPathExpansion(shill::kTypeProperty, properties->SetWithoutPathExpansion(shill::kTypeProperty,
base::Value::CreateStringValue(type)); base::Value::CreateStringValue(type));
properties->SetWithoutPathExpansion(
shill::kNameProperty,
base::Value::CreateStringValue(object_path));
properties->SetWithoutPathExpansion( properties->SetWithoutPathExpansion(
shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path));
properties->SetWithoutPathExpansion( properties->SetWithoutPathExpansion(
......
...@@ -731,6 +731,14 @@ void NetworkStateHandler::ManagedStateListChanged( ...@@ -731,6 +731,14 @@ void NetworkStateHandler::ManagedStateListChanged(
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedShared", shared); UMA_HISTOGRAM_COUNTS_100("Networks.RememberedShared", shared);
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedUnshared", unshared); UMA_HISTOGRAM_COUNTS_100("Networks.RememberedUnshared", unshared);
} else if (type == ManagedState::MANAGED_TYPE_DEVICE) { } else if (type == ManagedState::MANAGED_TYPE_DEVICE) {
std::string devices;
for (ManagedStateList::const_iterator iter = device_list_.begin();
iter != device_list_.end(); ++iter) {
if (iter != device_list_.begin())
devices += ", ";
devices += (*iter)->name();
}
NET_LOG_EVENT("DeviceList:", devices);
NotifyDeviceListChanged(); NotifyDeviceListChanged();
} else { } else {
NOTREACHED(); NOTREACHED();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "chromeos/network/shill_property_handler.h" #include "chromeos/network/shill_property_handler.h"
#include <sstream>
#include "base/bind.h" #include "base/bind.h"
#include "base/format_macros.h" #include "base/format_macros.h"
#include "base/stl_util.h" #include "base/stl_util.h"
...@@ -412,9 +414,10 @@ void ShillPropertyHandler::UpdateObserved(ManagedState::ManagedType type, ...@@ -412,9 +414,10 @@ void ShillPropertyHandler::UpdateObserved(ManagedState::ManagedType type,
void ShillPropertyHandler::UpdateAvailableTechnologies( void ShillPropertyHandler::UpdateAvailableTechnologies(
const base::ListValue& technologies) { const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("AvailableTechnologies:", technologies_str.str());
available_technologies_.clear(); available_technologies_.clear();
NET_LOG_EVENT("AvailableTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin(); for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) { iter != technologies.end(); ++iter) {
std::string technology; std::string technology;
...@@ -427,9 +430,10 @@ void ShillPropertyHandler::UpdateAvailableTechnologies( ...@@ -427,9 +430,10 @@ void ShillPropertyHandler::UpdateAvailableTechnologies(
void ShillPropertyHandler::UpdateEnabledTechnologies( void ShillPropertyHandler::UpdateEnabledTechnologies(
const base::ListValue& technologies) { const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("EnabledTechnologies:", technologies_str.str());
enabled_technologies_.clear(); enabled_technologies_.clear();
NET_LOG_EVENT("EnabledTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin(); for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) { iter != technologies.end(); ++iter) {
std::string technology; std::string technology;
...@@ -443,9 +447,10 @@ void ShillPropertyHandler::UpdateEnabledTechnologies( ...@@ -443,9 +447,10 @@ void ShillPropertyHandler::UpdateEnabledTechnologies(
void ShillPropertyHandler::UpdateUninitializedTechnologies( void ShillPropertyHandler::UpdateUninitializedTechnologies(
const base::ListValue& technologies) { const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("UninitializedTechnologies:", technologies_str.str());
uninitialized_technologies_.clear(); uninitialized_technologies_.clear();
NET_LOG_EVENT("UninitializedTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin(); for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) { iter != technologies.end(); ++iter) {
std::string technology; std::string technology;
......
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