0

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
This commit is contained in:
stevenjb@chromium.org
2014-05-21 01:59:49 +00:00
parent 5efb527a19
commit 3c320550d4
3 changed files with 22 additions and 6 deletions

@ -245,6 +245,9 @@ void FakeShillDeviceClient::AddDevice(const std::string& device_path,
base::DictionaryValue* properties = GetDeviceProperties(device_path);
properties->SetWithoutPathExpansion(shill::kTypeProperty,
base::Value::CreateStringValue(type));
properties->SetWithoutPathExpansion(
shill::kNameProperty,
base::Value::CreateStringValue(object_path));
properties->SetWithoutPathExpansion(
shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path));
properties->SetWithoutPathExpansion(

@ -731,6 +731,14 @@ void NetworkStateHandler::ManagedStateListChanged(
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedShared", shared);
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedUnshared", unshared);
} 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();
} else {
NOTREACHED();

@ -4,6 +4,8 @@
#include "chromeos/network/shill_property_handler.h"
#include <sstream>
#include "base/bind.h"
#include "base/format_macros.h"
#include "base/stl_util.h"
@ -412,9 +414,10 @@ void ShillPropertyHandler::UpdateObserved(ManagedState::ManagedType type,
void ShillPropertyHandler::UpdateAvailableTechnologies(
const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("AvailableTechnologies:", technologies_str.str());
available_technologies_.clear();
NET_LOG_EVENT("AvailableTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) {
std::string technology;
@ -427,9 +430,10 @@ void ShillPropertyHandler::UpdateAvailableTechnologies(
void ShillPropertyHandler::UpdateEnabledTechnologies(
const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("EnabledTechnologies:", technologies_str.str());
enabled_technologies_.clear();
NET_LOG_EVENT("EnabledTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) {
std::string technology;
@ -443,9 +447,10 @@ void ShillPropertyHandler::UpdateEnabledTechnologies(
void ShillPropertyHandler::UpdateUninitializedTechnologies(
const base::ListValue& technologies) {
std::stringstream technologies_str;
technologies_str << technologies;
NET_LOG_EVENT("UninitializedTechnologies:", technologies_str.str());
uninitialized_technologies_.clear();
NET_LOG_EVENT("UninitializedTechnologiesChanged",
base::StringPrintf("Size: %" PRIuS, technologies.GetSize()));
for (base::ListValue::const_iterator iter = technologies.begin();
iter != technologies.end(); ++iter) {
std::string technology;