From 500d809f51cbef89244eb6d6976261f30e5cda07 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 17 Dec 2018 19:10:03 +0300 Subject: [PATCH] Improve connections logging. GitOrigin-RevId: e0c11b91c016fce49f4ba4036f92a19a0dfc681b --- td/telegram/net/ConnectionCreator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index 5b1566c8..1b66bf68 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -1060,8 +1060,13 @@ void ConnectionCreator::client_create_raw_connection(Result r_co string debug_str, uint32 network_generation) { auto promise = PromiseCreator::lambda([actor_id = actor_id(this), hash, check_mode, debug_str](Result> result) mutable { - VLOG(connections) << "Ready connection " << (check_mode ? "(" : "(un") << "checked) " - << (result.is_ok() ? result.ok().get() : nullptr) << " " << debug_str; + if (result.is_ok()) { + 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); });