diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2022-05-09 10:59:19 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2022-05-09 10:59:19 +0200 |
commit | bd769ae7d72860d201a201cc6e3f68ffa66f4add (patch) | |
tree | 48a052fb345ca4cd02ce9b2ae3be2fd71c8ace48 | |
parent | 1a21b3ccd09e5cebf60e944f5adc74ae7383f160 (diff) | |
download | justbuild-bd769ae7d72860d201a201cc6e3f68ffa66f4add.tar.gz |
log to Error level when remote is unreachable
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<google::longrunning::Operation>* reader, bool wait) -> std::optional<google::longrunning::Operation> { 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; } } |