From da3baf09e9b01876f5dbbe9b9923968ab7f28a63 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 4 Apr 2022 19:08:47 +0300 Subject: [PATCH] Improve logging. --- td/telegram/DownloadManager.cpp | 2 ++ td/telegram/MessagesManager.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/td/telegram/DownloadManager.cpp b/td/telegram/DownloadManager.cpp index 5a6b1838d..88c784dc2 100644 --- a/td/telegram/DownloadManager.cpp +++ b/td/telegram/DownloadManager.cpp @@ -335,6 +335,7 @@ class DownloadManagerImpl final : public DownloadManager { return; } + LOG(INFO) << "File " << file_id << " was viewed from " << file_source_id; auto r_file_info_ptr = get_file_info(file_id, file_source_id); if (r_file_info_ptr.is_error()) { return; @@ -760,6 +761,7 @@ class DownloadManagerImpl final : public DownloadManager { return; } + LOG(INFO) << "Mark download " << download_id << " as viewed"; unviewed_completed_download_ids_.erase(download_id); if (unviewed_completed_download_ids_.empty()) { clear_counters(); diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 9eaf24971..065c9aa5b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -20878,6 +20878,7 @@ Status MessagesManager::view_messages(DialogId dialog_id, MessageId top_thread_m auto it = full_message_id_to_file_source_id_.find({dialog_id, m->message_id}); if (it != full_message_id_to_file_source_id_.end()) { auto file_source_id = it->second; + LOG(INFO) << "Have " << file_source_id << " for " << m->message_id; CHECK(file_source_id.is_valid()); for (auto file_id : get_message_file_ids(m)) { auto file_view = td_->file_manager_->get_file_view(file_id);