Improve logging.

GitOrigin-RevId: ea4019e25d2e9413c5eed2d5dde5a7c9b58e1d1a
This commit is contained in:
levlam 2020-05-05 00:37:27 +03:00
parent 69ddff66bc
commit 5e02099069
2 changed files with 14 additions and 5 deletions

View File

@ -2295,8 +2295,12 @@ tl_object_ptr<telegram_api::InputMedia> get_input_media(const MessageContent *co
} }
if (!was_uploaded) { if (!was_uploaded) {
auto file_reference = FileManager::extract_file_reference(input_media); auto file_reference = FileManager::extract_file_reference(input_media);
if (file_reference == FileReferenceView::invalid_file_reference() && !force) { if (file_reference == FileReferenceView::invalid_file_reference()) {
return nullptr; if (!force) {
LOG(INFO) << "File " << file_id << " has invalid file reference";
return nullptr;
}
LOG(ERROR) << "File " << file_id << " has invalid file reference, but we forced to use it";
} }
} }
return input_media; return input_media;
@ -2305,8 +2309,13 @@ tl_object_ptr<telegram_api::InputMedia> get_input_media(const MessageContent *co
tl_object_ptr<telegram_api::InputMedia> get_input_media(const MessageContent *content, Td *td, int32 ttl, bool force) { tl_object_ptr<telegram_api::InputMedia> get_input_media(const MessageContent *content, Td *td, int32 ttl, bool force) {
auto input_media = get_input_media_impl(content, td, nullptr, nullptr, ttl); auto input_media = get_input_media_impl(content, td, nullptr, nullptr, ttl);
auto file_reference = FileManager::extract_file_reference(input_media); auto file_reference = FileManager::extract_file_reference(input_media);
if (file_reference == FileReferenceView::invalid_file_reference() && !force) { if (file_reference == FileReferenceView::invalid_file_reference()) {
return nullptr; auto file_id = get_message_content_upload_file_id(content);
if (!force) {
LOG(INFO) << "File " << file_id << " has invalid file reference";
return nullptr;
}
LOG(ERROR) << "File " << file_id << " has invalid file reference, but we forced to use it";
} }
return input_media; return input_media;
} }

View File

@ -28970,7 +28970,7 @@ void MessagesManager::set_channel_pts(Dialog *d, int32 new_pts, const char *sour
G()->td_db()->get_binlog_pmc()->set(get_channel_pts_key(d->dialog_id), to_string(new_pts)); G()->td_db()->get_binlog_pmc()->set(get_channel_pts_key(d->dialog_id), to_string(new_pts));
} }
} else if (new_pts < d->pts) { } else if (new_pts < d->pts) {
LOG(ERROR) << "Receive wrong pts " << new_pts << " in " << d->dialog_id << " . Current pts is " << d->pts; LOG(ERROR) << "Receive wrong pts " << new_pts << " in " << d->dialog_id << ". Current pts is " << d->pts;
} }
} }