From bd769ae7d72860d201a201cc6e3f68ffa66f4add Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 9 May 2022 10:59:19 +0200 Subject: log to Error level when remote is unreachable --- .../execution_api/remote/bazel/bazel_execution_client.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp index 3b95a8ff..735f3b45 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp @@ -57,7 +57,10 @@ auto BazelExecutionClient::ReadExecution( grpc::ClientReader* reader, bool wait) -> std::optional { if (reader == nullptr) { - // TODO(vmoreno): log error + LogStatus( + &logger_, + LogLevel::Error, + grpc::Status{grpc::StatusCode::UNKNOWN, "Reader unavailable"}); return std::nullopt; } @@ -65,7 +68,7 @@ auto BazelExecutionClient::ReadExecution( if (not reader->Read(&operation)) { grpc::Status status = reader->Finish(); // TODO(vmoreno): log error using data in status and operation - LogStatus(&logger_, LogLevel::Debug, status); + LogStatus(&logger_, LogLevel::Error, status); return std::nullopt; } // Important note: do not call reader->Finish() unless reader->Read() @@ -76,7 +79,7 @@ auto BazelExecutionClient::ReadExecution( grpc::Status status = reader->Finish(); if (not status.ok()) { // TODO(vmoreno): log error from status and operation - LogStatus(&logger_, LogLevel::Debug, status); + LogStatus(&logger_, LogLevel::Error, status); return std::nullopt; } } -- cgit v1.2.3