Internal change

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