shill: improve service logging
- In Service::Connect: log the unique name of the service
we're connecting to, as well as the function that triggered
the connect.
- In *Service: ensure all derived classes call into the
base class' Connect method.
- In Service::ThrottleFutureAutoConnects: clarify log message
- In Service::Disconnect: log the unique_name of the service
- In WiFi::BSSRemovedTask: log the affected service
- In WiFiService::Connect: don't attempt a connection if the
security parameter was unrecognized.
- In Service ctor: LogSSID of FriendlyName at INFO.
BUG=chromium:220496
TEST=unit tests
Change-Id: If254d081c7426dc6adff5aeab2c99122f6742efe
Reviewed-on: https://gerrit.chromium.org/gerrit/47510
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
diff --git a/vpn_service.cc b/vpn_service.cc
index f8c0a0e..f5f3e16 100644
--- a/vpn_service.cc
+++ b/vpn_service.cc
@@ -42,14 +42,13 @@
VPNService::~VPNService() {}
-void VPNService::Connect(Error *error) {
- LOG(INFO) << "Connect to service " << unique_name();
+void VPNService::Connect(Error *error, const char *reason) {
if (IsConnected() || IsConnecting()) {
Error::PopulateAndLog(
error, Error::kAlreadyConnected, "VPN service already connected.");
return;
}
- Service::Connect(error);
+ Service::Connect(error, reason);
driver_->Connect(this, error);
}