0

Reduce log spew.

* Lower a non-critical FIDO log from ERROR to DEBUG.
* Lower test server LOG(ERROR)s to DVLOG(1).
* Lower test server LOG(WARNING) to DVLOG(2).

Bug: none
Change-Id: I3c1ebd9f891c5eb1f337d5c35981dab06bb2f4fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6178391
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: Eric Orth <ericorth@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407653}
This commit is contained in:
Peter Kasting
2025-01-16 16:47:53 -08:00
committed by Chromium LUCI CQ
parent 992d2d92da
commit 249990e984
2 changed files with 9 additions and 10 deletions
device/fido
net/test/embedded_test_server

@@ -344,7 +344,7 @@ std::optional<AuthenticatorGetInfoResponse> ReadCTAPGetInfoResponse(
return std::nullopt; return std::nullopt;
} }
if (GetResponseCode(buffer) != CtapDeviceResponseCode::kSuccess) { if (GetResponseCode(buffer) != CtapDeviceResponseCode::kSuccess) {
FIDO_LOG(ERROR) << "-> (GetInfo CTAP2 error code " << +buffer[0] << ")"; FIDO_LOG(DEBUG) << "-> (GetInfo CTAP2 error code " << +buffer[0] << ")";
return std::nullopt; return std::nullopt;
} }

@@ -347,8 +347,8 @@ bool EmbeddedTestServer::InitializeAndListen(int port,
do { do {
if (++num_tries > max_tries) { if (++num_tries > max_tries) {
LOG(ERROR) << "Failed to listen on a valid port after " << max_tries DVLOG(1) << "Failed to listen on a valid port after " << max_tries
<< " attempts."; << " attempts.";
listen_socket_.reset(); listen_socket_.reset();
return false; return false;
} }
@@ -358,14 +358,14 @@ bool EmbeddedTestServer::InitializeAndListen(int port,
int result = int result =
listen_socket_->ListenWithAddressAndPort(address.data(), port, 10); listen_socket_->ListenWithAddressAndPort(address.data(), port, 10);
if (result) { if (result) {
LOG(ERROR) << "Listen failed: " << ErrorToString(result); DVLOG(1) << "Listen failed: " << ErrorToString(result);
listen_socket_.reset(); listen_socket_.reset();
return false; return false;
} }
result = listen_socket_->GetLocalAddress(&local_endpoint_); result = listen_socket_->GetLocalAddress(&local_endpoint_);
if (result != OK) { if (result != OK) {
LOG(ERROR) << "GetLocalAddress failed: " << ErrorToString(result); DVLOG(1) << "GetLocalAddress failed: " << ErrorToString(result);
listen_socket_.reset(); listen_socket_.reset();
return false; return false;
} }
@@ -388,7 +388,7 @@ bool EmbeddedTestServer::InitializeAndListen(int port,
listen_socket_->DetachFromThread(); listen_socket_->DetachFromThread();
if (is_using_ssl_ && !InitializeSSLServerContext()) { if (is_using_ssl_ && !InitializeSSLServerContext()) {
LOG(ERROR) << "Unable to initialize SSL"; DVLOG(1) << "Unable to initialize SSL";
return false; return false;
} }
@@ -577,12 +577,12 @@ bool EmbeddedTestServer::GenerateCertAndKey() {
bool EmbeddedTestServer::InitializeSSLServerContext() { bool EmbeddedTestServer::InitializeSSLServerContext() {
if (UsingStaticCert()) { if (UsingStaticCert()) {
if (!InitializeCertAndKeyFromFile()) { if (!InitializeCertAndKeyFromFile()) {
LOG(ERROR) << "Unable to initialize cert and key from file"; DVLOG(1) << "Unable to initialize cert and key from file";
return false; return false;
} }
} else { } else {
if (!GenerateCertAndKey()) { if (!GenerateCertAndKey()) {
LOG(ERROR) << "Unable to generate cert and key"; DVLOG(1) << "Unable to generate cert and key";
return false; return false;
} }
} }
@@ -769,8 +769,7 @@ void EmbeddedTestServer::HandleRequest(
} }
if (!response) { if (!response) {
LOG(WARNING) << "Request not handled. Returning 404: " DVLOG(2) << "Request not handled. Returning 404: " << request->relative_url;
<< request->relative_url;
auto not_found_response = std::make_unique<BasicHttpResponse>(); auto not_found_response = std::make_unique<BasicHttpResponse>();
not_found_response->set_code(HTTP_NOT_FOUND); not_found_response->set_code(HTTP_NOT_FOUND);
response = std::move(not_found_response); response = std::move(not_found_response);