Internal change

PiperOrigin-RevId: 370664271
This commit is contained in:
hai007
2021-04-27 06:16:48 -07:00
committed by Copybara-Service
parent b9e75b60a4
commit a45898859b
3 changed files with 54 additions and 43 deletions
+21 -15
View File
@@ -70,8 +70,8 @@ void CancelableAlarmRunnable(ClientProxy* client,
const std::string& endpoint_id,
EndpointChannel* endpoint_channel) {
NEARBY_LOG(INFO,
"Timing out encryption for client %" PRId64
" to endpoint %s after %" PRId64 " ms",
"Timing out encryption for client %x" PRIx64
" to endpoint_id=%s after %" PRId64 " ms",
client->GetClientId(), endpoint_id.c_str(),
static_cast<std::int64_t>(absl::ToInt64Milliseconds(kTimeout)));
endpoint_channel->Close();
@@ -123,7 +123,8 @@ class ServerRunnable final {
return;
}
NEARBY_LOG(INFO, "In StartServer(), read UKEY2 Message 1 from endpoint %s",
NEARBY_LOG(INFO,
"In StartServer(), read UKEY2 Message 1 from endpoint(id=%s).",
endpoint_id_.c_str());
// Message 2 (Server Init)
@@ -145,7 +146,8 @@ class ServerRunnable final {
return;
}
NEARBY_LOG(INFO, "In StartServer(), wrote UKEY2 Message 2 to endpoint %s",
NEARBY_LOG(INFO,
"In StartServer(), wrote UKEY2 Message 2 to endpoint(id=%s).",
endpoint_id_.c_str());
// Message 3 (Client Finish)
@@ -170,7 +172,8 @@ class ServerRunnable final {
return;
}
NEARBY_LOG(INFO, "In StartServer(), read UKEY2 Message 3 from endpoint %s",
NEARBY_LOG(INFO,
"In StartServer(), read UKEY2 Message 3 from endpoint(id=%s).",
endpoint_id_.c_str());
timeout_alarm.Cancel();
@@ -184,7 +187,7 @@ class ServerRunnable final {
private:
void LogException() const {
NEARBY_LOG(ERROR, "In StartServer(), UKEY2 failed with endpoint %s",
NEARBY_LOG(ERROR, "In StartServer(), UKEY2 failed with endpoint(id=%s).",
endpoint_id_.c_str());
}
@@ -199,8 +202,8 @@ class ServerRunnable final {
channel_->Write(ByteArray(*parse_result.alert_to_send));
if (!write_exception.Ok()) {
NEARBY_LOG(WARNING,
"In StartServer(), client %" PRId64
" failed to pass the alert error message to endpoint %s",
"In StartServer(), client %x" PRIx64
" failed to pass the alert error message to endpoint(id=%s).",
client_->GetClientId(), endpoint_id_.c_str());
}
}
@@ -225,7 +228,7 @@ class ClientRunnable final {
void operator()() const {
CancelableAlarm timeout_alarm(
"EncryptionRunner.startClient() timeout",
"EncryptionRunner.StartClient() timeout",
[this]() { CancelableAlarmRunnable(client_, endpoint_id_, channel_); },
kTimeout, alarm_executor_);
@@ -257,7 +260,8 @@ class ClientRunnable final {
return;
}
NEARBY_LOG(INFO, "In startClient(), wrote UKEY2 Message 1 to endpoint %s",
NEARBY_LOG(INFO,
"In StartClient(), wrote UKEY2 Message 1 to endpoint(id=%s).",
endpoint_id_.c_str());
// Message 2 (Server Init)
@@ -282,7 +286,8 @@ class ClientRunnable final {
return;
}
NEARBY_LOG(INFO, "In startClient(), read UKEY2 Message 2 from endpoint %s",
NEARBY_LOG(INFO,
"In StartClient(), read UKEY2 Message 2 from endpoint(id=%s).",
endpoint_id_.c_str());
// Message 3 (Client Finish)
@@ -304,7 +309,8 @@ class ClientRunnable final {
return;
}
NEARBY_LOG(INFO, "In startClient(), wrote UKEY2 Message 3 to endpoint %s",
NEARBY_LOG(INFO,
"In StartClient(), wrote UKEY2 Message 3 to endpoint(id=%s).",
endpoint_id_.c_str());
timeout_alarm.Cancel();
@@ -318,7 +324,7 @@ class ClientRunnable final {
private:
void LogException() const {
NEARBY_LOG(ERROR, "In startClient(), UKEY2 failed with endpoint %s",
NEARBY_LOG(ERROR, "In StartClient(), UKEY2 failed with endpoint(id=%s).",
endpoint_id_.c_str());
}
@@ -333,8 +339,8 @@ class ClientRunnable final {
channel_->Write(ByteArray(*parse_result.alert_to_send));
if (!write_exception.Ok()) {
NEARBY_LOG(WARNING,
"In startClient(), client %" PRId64
" failed to pass the alert error message to endpoint %s",
"In StartClient(), client %x" PRIx64
" failed to pass the alert error message to endpoint(id=%s).",
client_->GetClientId(), endpoint_id_.c_str());
}
}