Improve connections logging.

GitOrigin-RevId: e0c11b91c016fce49f4ba4036f92a19a0dfc681b
This commit is contained in:
levlam 2018-12-17 19:10:03 +03:00
parent f81709acde
commit 500d809f51

View File

@ -1060,8 +1060,13 @@ void ConnectionCreator::client_create_raw_connection(Result<ConnectionData> r_co
string debug_str, uint32 network_generation) { string debug_str, uint32 network_generation) {
auto promise = PromiseCreator::lambda([actor_id = actor_id(this), hash, check_mode, auto promise = PromiseCreator::lambda([actor_id = actor_id(this), hash, check_mode,
debug_str](Result<unique_ptr<mtproto::RawConnection>> result) mutable { debug_str](Result<unique_ptr<mtproto::RawConnection>> result) mutable {
VLOG(connections) << "Ready connection " << (check_mode ? "(" : "(un") << "checked) " if (result.is_ok()) {
<< (result.is_ok() ? result.ok().get() : nullptr) << " " << debug_str; VLOG(connections) << "Ready connection (" << (check_mode ? "" : "un") << "checked) " << result.ok().get() << ' '
<< debug_str;
} else {
VLOG(connections) << "Failed connection (" << (check_mode ? "" : "un") << "checked) " << result.error() << ' '
<< debug_str;
}
send_closure(std::move(actor_id), &ConnectionCreator::client_add_connection, hash, std::move(result), check_mode); send_closure(std::move(actor_id), &ConnectionCreator::client_add_connection, hash, std::move(result), check_mode);
}); });