shill: Replace VLOG with SLOG.
This CL replaces all uses of VLOG(level) with SLOG(scope, level) with
the same verbose level and an appropriate scope for each affected
logging statement.
BUG=chromium-os:29641
TEST=Build and run unit tests. Test scope logging with ff_debug.
Change-Id: Ifdcf1faa2a309bcbd9ee369a66179ce9c7f1ad19
Reviewed-on: https://gerrit.chromium.org/gerrit/20629
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/http_request.cc b/http_request.cc
index bf22225..bd66ea3 100644
--- a/http_request.cc
+++ b/http_request.cc
@@ -18,6 +18,7 @@
#include "shill/event_dispatcher.h"
#include "shill/http_url.h"
#include "shill/ip_address.h"
+#include "shill/scope_logger.h"
#include "shill/sockets.h"
using base::Bind;
@@ -76,7 +77,7 @@
const HTTPURL &url,
const Callback<void(const ByteString &)> &read_event_callback,
const Callback<void(Result, const ByteString &)> &result_callback) {
- VLOG(3) << "In " << __func__;
+ SLOG(HTTP, 3) << "In " << __func__;
DCHECK(!is_running_);
@@ -98,7 +99,7 @@
return kResultConnectionFailure;
}
} else {
- VLOG(3) << "Looking up host: " << server_hostname_;
+ SLOG(HTTP, 3) << "Looking up host: " << server_hostname_;
Error error;
if (!dns_client_->Start(server_hostname_, &error)) {
LOG(ERROR) << "Failed to start DNS client: " << error.message();
@@ -115,7 +116,7 @@
}
void HTTPRequest::Stop() {
- VLOG(3) << "In " << __func__ << "; running is " << is_running_;
+ SLOG(HTTP, 3) << "In " << __func__ << "; running is " << is_running_;
if (!is_running_) {
return;
@@ -145,7 +146,7 @@
}
bool HTTPRequest::ConnectServer(const IPAddress &address, int port) {
- VLOG(3) << "In " << __func__;
+ SLOG(HTTP, 3) << "In " << __func__;
if (!server_async_connection_->Start(address, port)) {
LOG(ERROR) << "Could not create socket to connect to server at "
<< address.ToString();
@@ -161,7 +162,7 @@
// DNSClient callback that fires when the DNS request completes.
void HTTPRequest::GetDNSResult(const Error &error, const IPAddress &address) {
- VLOG(3) << "In " << __func__;
+ SLOG(HTTP, 3) << "In " << __func__;
if (!error.IsSuccess()) {
LOG(ERROR) << "Could not resolve hostname "
<< server_hostname_
@@ -180,7 +181,7 @@
// AsyncConnection callback routine which fires when the asynchronous Connect()
// to the remote server completes (or fails).
void HTTPRequest::OnConnectCompletion(bool success, int fd) {
- VLOG(3) << "In " << __func__;
+ SLOG(HTTP, 3) << "In " << __func__;
if (!success) {
LOG(ERROR) << "Socket connection delayed failure to "
<< server_hostname_
@@ -200,7 +201,7 @@
// IOInputHandler callback which fires when data has been read from the
// server.
void HTTPRequest::ReadFromServer(InputData *data) {
- VLOG(3) << "In " << __func__ << " length " << data->len;
+ SLOG(HTTP, 3) << "In " << __func__ << " length " << data->len;
if (data->len == 0) {
SendStatus(kResultSuccess);
return;
@@ -250,8 +251,8 @@
request_data_.GetLength(), 0);
CHECK(static_cast<size_t>(ret) <= request_data_.GetLength());
- VLOG(3) << "In " << __func__ << " wrote " << ret << " of " <<
- request_data_.GetLength();
+ SLOG(HTTP, 3) << "In " << __func__ << " wrote " << ret << " of "
+ << request_data_.GetLength();
if (ret < 0) {
LOG(ERROR) << "Client write failed to "