shill: reduce logspam due to autoconnect

It's quite normal, and frequent, for an autoconnect request
(from the Manager, to a Service), to be supressed because
  a) we're already connected to that Service, or
  b) the Device needed by this Service is busy.

Reduce log-spam by logging those cases with SLOG at level 1,
rather than at LOG_INFO.

Checking a couple of the log files on one of my Chromebooks,
this would reduce the number of shill log lines by 7-8%.

While there: consolidate the kAutoConnConnected string into
Service. (It was previously defined independently in WiFiService
and WiMaxService.)

BUG=chromium-os:31143
TEST=unit tests

Change-Id: Ifc94e1357674999e65eb7b3ec98f6381ea59fc0d
Reviewed-on: https://gerrit.chromium.org/gerrit/38974
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/service_unittest.cc b/service_unittest.cc
index f21e8ee..76c7316 100644
--- a/service_unittest.cc
+++ b/service_unittest.cc
@@ -480,6 +480,26 @@
   EXPECT_STREQ(Service::kAutoConnConnecting, reason);
 }
 
+TEST_F(ServiceTest, AutoConnectLogging) {
+  ScopedMockLog log;
+  EXPECT_CALL(log, Log(_, _, _));
+  service_->set_connectable(true);
+
+  ScopeLogger::GetInstance()->EnableScopesByName("+service");
+  ScopeLogger::GetInstance()->set_verbose_level(1);
+  service_->SetState(Service::kStateConnected);
+  EXPECT_CALL(log, Log(-1, _, HasSubstr(Service::kAutoConnConnected)));
+  service_->AutoConnect();
+
+  ScopeLogger::GetInstance()->EnableScopesByName("-service");
+  ScopeLogger::GetInstance()->set_verbose_level(0);
+  EXPECT_CALL(log, Log(logging::LOG_INFO, _,
+                       HasSubstr(Service::kAutoConnNotConnectable)));
+  service_->set_connectable(false);
+  service_->AutoConnect();
+}
+
+
 TEST_F(AllMockServiceTest, AutoConnectWithFailures) {
   const char *reason;
   service_->set_connectable(true);