From c12ed8d9ccc503880491f38eb3c846ab4814814a Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 22 Aug 2018 04:04:09 +0300 Subject: [PATCH] Improve logging. GitOrigin-RevId: b361ebec579228514f4531465144d49aeb2cd7b5 --- td/mtproto/SessionConnection.cpp | 4 ++-- td/mtproto/Transport.cpp | 4 ++-- td/telegram/LanguagePackManager.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/td/mtproto/SessionConnection.cpp b/td/mtproto/SessionConnection.cpp index f6605215..862e081a 100644 --- a/td/mtproto/SessionConnection.cpp +++ b/td/mtproto/SessionConnection.cpp @@ -506,8 +506,8 @@ Status SessionConnection::on_main_packet(const PacketInfo &info, Slice packet) { callback_->on_connected(); } - VLOG(raw_mtproto) << "Got packet: [session_id:" << format::as_hex(info.session_id) << "] " - << format::as_hex_dump<4>(packet); + VLOG(raw_mtproto) << "Got packet of size " << packet.size() << " from session " << format::as_hex(info.session_id) + << ":" << format::as_hex_dump<4>(packet); if (info.no_crypto_flag) { return Status::Error("Unencrypted packet"); } diff --git a/td/mtproto/Transport.cpp b/td/mtproto/Transport.cpp index 4b772308..95cce51f 100644 --- a/td/mtproto/Transport.cpp +++ b/td/mtproto/Transport.cpp @@ -204,8 +204,8 @@ void Transport::write_crypto_impl(int X, const Storer &storer, const AuthKey &au HeaderT *header, size_t data_size) { auto real_data_size = storer.store(header->data); CHECK(real_data_size == data_size); - VLOG(raw_mtproto) << "SEND" << format::as_hex_dump<4>(Slice(header->data, data_size)); - // LOG(ERROR) << "SEND" << format::as_hex_dump<4>(Slice(header->data, data_size)) << info->version; + VLOG(raw_mtproto) << "Send packet of size " << data_size << " to session " << format::as_hex(info->session_id) << ":" + << format::as_hex_dump<4>(Slice(header->data, data_size)); size_t size = 0; if (info->version == 1) { diff --git a/td/telegram/LanguagePackManager.cpp b/td/telegram/LanguagePackManager.cpp index 4d32b947..def71aa9 100644 --- a/td/telegram/LanguagePackManager.cpp +++ b/td/telegram/LanguagePackManager.cpp @@ -149,7 +149,7 @@ void LanguagePackManager::start_up() { database_ = add_language_database(G()->shared_config().get_option_string("language_database_path")); auto language = add_language(database_, language_pack_, language_code_); - LOG(INFO) << "Use language pack " << language_pack_ << " with language " << language_code_ << " of version " + LOG(INFO) << "Use language pack \"" << language_pack_ << "\" with language \"" << language_code_ << "\" of version " << language->version_.load() << " with database \"" << database_->path_ << '"'; }