shill: Add a little more verbosity

Add a little more verbosity to the GetService/CreateService process,
as well as some more detail in the failure case for SetProperty(Name).

BUG=None
TEST=Unit tests.

Change-Id: Ie526a75f9052d97363c9975ba34cd354d2604e60
Reviewed-on: https://gerrit.chromium.org/gerrit/20045
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/manager.cc b/manager.cc
index bf469b0..9766afc 100644
--- a/manager.cc
+++ b/manager.cc
@@ -205,6 +205,7 @@
 }
 
 void Manager::CreateProfile(const string &name, string *path, Error *error) {
+  VLOG(2) << __func__ << " " << name;
   Profile::Identifier ident;
   if (!Profile::ParseIdentifier(name, &ident)) {
     Error::PopulateAndLog(error, Error::kInvalidArguments,
@@ -243,6 +244,7 @@
 }
 
 void Manager::PushProfile(const string &name, string *path, Error *error) {
+  VLOG(2) << __func__ << " " << name;
   Profile::Identifier ident;
   if (!Profile::ParseIdentifier(name, &ident)) {
     Error::PopulateAndLog(error, Error::kInvalidArguments,
@@ -342,6 +344,7 @@
 }
 
 void Manager::PopProfile(const string &name, Error *error) {
+  VLOG(2) << __func__ << " " << name;
   Profile::Identifier ident;
   if (profiles_.empty()) {
     Error::PopulateAndLog(error, Error::kNotFound, "Profile stack is empty");
@@ -362,6 +365,7 @@
 }
 
 void Manager::PopAnyProfile(Error *error) {
+  VLOG(2) << __func__;
   Profile::Identifier ident;
   if (profiles_.empty()) {
     Error::PopulateAndLog(error, Error::kNotFound, "Profile stack is empty");
@@ -967,6 +971,7 @@
 // called via RPC (e.g., from ManagerDBusAdaptor)
 ServiceRefPtr Manager::GetService(const KeyValueStore &args, Error *error) {
   if (args.ContainsString(flimflam::kGuidProperty)) {
+    VLOG(2) << __func__ << ": searching by GUID";
     ServiceRefPtr service =
         GetServiceWithGUID(args.GetString(flimflam::kGuidProperty), NULL);
     if (service) {
@@ -982,9 +987,11 @@
 
   string type = args.GetString(flimflam::kTypeProperty);
   if (type == flimflam::kTypeWifi) {
+    VLOG(2) << __func__ << ": getting WiFi Service";
     return GetWifiService(args, error);
   }
   if (type == flimflam::kTypeVPN) {
+    VLOG(2) << __func__ << ": getting VPN Service";
     return vpn_provider_.GetService(args, error);
   }
   error->Populate(Error::kNotSupported, kErrorUnsupportedServiceType);
diff --git a/service.cc b/service.cc
index 927eddd..45ab41b 100644
--- a/service.cc
+++ b/service.cc
@@ -14,6 +14,7 @@
 #include <base/logging.h>
 #include <base/memory/scoped_ptr.h>
 #include <base/string_number_conversions.h>
+#include <base/stringprintf.h>
 #include <chromeos/dbus/service_constants.h>
 
 #include "shill/connection.h"
@@ -183,9 +184,6 @@
                             &Service::GetProfileRpcId,
                             &Service::SetProfileRpcId);
   store_.RegisterString(flimflam::kProxyConfigProperty, &proxy_config_);
-  // TODO(cmasone): Create VPN Service with this property
-  // store_.RegisterConstStringmap(flimflam::kProviderProperty, &provider_);
-
   store_.RegisterBool(flimflam::kSaveCredentialsProperty, &save_credentials_);
   HelpRegisterDerivedString(flimflam::kTypeProperty,
                             &Service::GetTechnologyString,
@@ -866,7 +864,10 @@
 void Service::AssertTrivialSetNameProperty(const string &name, Error *error) {
   if (name != friendly_name_) {
     Error::PopulateAndLog(error, Error::kInvalidArguments,
-                          "Service Name property cannot be modified.");
+                          base::StringPrintf(
+                              "Service Name property cannot be modified "
+                              "(%s to %s)", friendly_name_.c_str(),
+                              name.c_str()));
   }
 }