Improve logging.

This commit is contained in:
levlam 2022-04-04 19:08:47 +03:00
parent 713debab58
commit da3baf09e9
2 changed files with 3 additions and 0 deletions

View File

@ -335,6 +335,7 @@ class DownloadManagerImpl final : public DownloadManager {
return; 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); auto r_file_info_ptr = get_file_info(file_id, file_source_id);
if (r_file_info_ptr.is_error()) { if (r_file_info_ptr.is_error()) {
return; return;
@ -760,6 +761,7 @@ class DownloadManagerImpl final : public DownloadManager {
return; return;
} }
LOG(INFO) << "Mark download " << download_id << " as viewed";
unviewed_completed_download_ids_.erase(download_id); unviewed_completed_download_ids_.erase(download_id);
if (unviewed_completed_download_ids_.empty()) { if (unviewed_completed_download_ids_.empty()) {
clear_counters(); clear_counters();

View File

@ -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}); 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()) { if (it != full_message_id_to_file_source_id_.end()) {
auto file_source_id = it->second; auto file_source_id = it->second;
LOG(INFO) << "Have " << file_source_id << " for " << m->message_id;
CHECK(file_source_id.is_valid()); CHECK(file_source_id.is_valid());
for (auto file_id : get_message_file_ids(m)) { for (auto file_id : get_message_file_ids(m)) {
auto file_view = td_->file_manager_->get_file_view(file_id); auto file_view = td_->file_manager_->get_file_view(file_id);