diff options
author | Raju Konduru <raju.konduru@globaledgesoft.com> | 2017-10-12 21:10:59 +0530 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-13 14:45:18 -0700 |
commit | 62b7538a31c4c5a88dcd2ef4d8a60a783ec6b6f7 (patch) | |
tree | 0c2aca9211a622d718bfa2e469ff5276a0ef7cd9 | |
parent | de7f50dfda51d534cb8bd23e73c2354925b2099a (diff) | |
download | platform_external_libbrillo-62b7538a31c4c5a88dcd2ef4d8a60a783ec6b6f7.tar.gz platform_external_libbrillo-62b7538a31c4c5a88dcd2ef4d8a60a783ec6b6f7.tar.bz2 platform_external_libbrillo-62b7538a31c4c5a88dcd2ef4d8a60a783ec6b6f7.zip |
libbrillo: Log Cleanup
1)Print curl request log only for failure case
2)Removed excess log
BUG=b:65480079
TEST=cros_workon_make --test --board=gale libbrillo
Change-Id: I7e9ef0fb43cb97506043d1c1e2b324facc132a85
Reviewed-on: https://chromium-review.googlesource.com/716437
Commit-Ready: jr.shashidhar jr.shashidhar <jr.shashidhar@globaledgesoftware.corp-partner.google.com>
Tested-by: jr.shashidhar jr.shashidhar <jr.shashidhar@globaledgesoftware.corp-partner.google.com>
Reviewed-by: Julan Hsu <julanhsu@google.com>
-rw-r--r-- | brillo/http/http_transport_curl.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/brillo/http/http_transport_curl.cc b/brillo/http/http_transport_curl.cc index 0cf902f..7c2472a 100644 --- a/brillo/http/http_transport_curl.cc +++ b/brillo/http/http_transport_curl.cc @@ -129,7 +129,7 @@ std::shared_ptr<http::Connection> Transport::CreateConnection( return connection; } - LOG(INFO) << "Sending a " << method << " request to " << url; + VLOG(1) << "Sending a " << method << " request to " << url; CURLcode code = curl_interface_->EasySetOptStr(curl_handle, CURLOPT_URL, url); if (code == CURLE_OK) { @@ -247,7 +247,7 @@ RequestID Transport::StartAsyncTransfer(http::Connection* connection, request_id_map_.erase(request_id); return 0; } - LOG(INFO) << "Started asynchronous HTTP request with ID " << request_id; + VLOG(1) << "Started asynchronous HTTP request with ID " << request_id; return request_id; } @@ -444,9 +444,9 @@ void Transport::OnTransferComplete(Connection* connection, CURLcode code) { auto p = async_requests_.find(connection); CHECK(p != async_requests_.end()) << "Unknown connection"; AsyncRequestData* request_data = p->second.get(); - LOG(INFO) << "HTTP request # " << request_data->request_id - << " has completed " - << (code == CURLE_OK ? "successfully" : "with an error"); + VLOG(1) << "HTTP request # " << request_data->request_id + << " has completed " + << (code == CURLE_OK ? "successfully" : "with an error"); if (code != CURLE_OK) { brillo::ErrorPtr error; AddEasyCurlError(&error, FROM_HERE, code, curl_interface_.get()); @@ -455,8 +455,10 @@ void Transport::OnTransferComplete(Connection* connection, CURLcode code) { p->second->request_id, base::Owned(error.release()))); } else { - LOG(INFO) << "Response: " << connection->GetResponseStatusCode() << " (" - << connection->GetResponseStatusText() << ")"; + if (connection->GetResponseStatusCode() != status_code::Ok) { + LOG(INFO) << "Response: " << connection->GetResponseStatusCode() << " (" + << connection->GetResponseStatusText() << ")"; + } brillo::ErrorPtr error; // Rewind the response data stream to the beginning so the clients can // read the data back. |