shill: increase logging for DHCPConfig

Log more detail about when and why we try to kill the dhcpcd process.
The messages are logged at INFO (for first kill attempt), and WARNING
(for subsequent attempts).

This should not spam the log file, as stopping DHCPConfig should be an
infrequent occurence.

BUG=chromium-os:37730
TEST=unit tests

Change-Id: I0310a03d6ba8ef9c648a16590f003a851eb37122
Reviewed-on: https://gerrit.chromium.org/gerrit/41337
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index 2654a70..559eb1a 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -27,6 +27,8 @@
 using std::string;
 using std::vector;
 using testing::_;
+using testing::AnyNumber;
+using testing::ContainsRegex;
 using testing::Return;
 using testing::SetArgumentPointee;
 using testing::Test;
@@ -553,8 +555,12 @@
 TEST_F(DHCPConfigTest, Stop) {
   // Ensure no crashes.
   const int kPID = 1 << 17;  // Ensure unknown positive PID.
+  ScopedMockLog log;
+  EXPECT_CALL(log, Log(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(log, Log(_, _, ContainsRegex(
+      base::StringPrintf("Terminating.+%s", __func__))));
   config_->pid_ = kPID;
-  config_->Stop();
+  config_->Stop(__func__);
   EXPECT_TRUE(config_->lease_acquisition_timeout_callback_.IsCancelled());
 }
 
@@ -565,7 +571,7 @@
   EXPECT_TRUE(config_->RenewIP());
   EXPECT_FALSE(config_->lease_acquisition_timeout_callback_.IsCancelled());
   config_->pid_ = 0;  // Keep Stop from killing a real process.
-  config_->Stop();
+  config_->Stop(__func__);
   EXPECT_TRUE(config_->lease_acquisition_timeout_callback_.IsCancelled());
 }