From e0adaebb913c572568a93fe6e4da1149d329e3f1 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 24 Sep 2020 16:08:04 +0300 Subject: [PATCH] Unify logging of request responses. GitOrigin-RevId: ae4c0a3881a89aa235baa08c07ec97a914437d8c --- td/telegram/BackgroundManager.cpp | 3 +- td/telegram/ContactsManager.cpp | 66 +++++++++---------- td/telegram/MessagesManager.cpp | 80 ++++++++++++------------ td/telegram/PollManager.cpp | 2 +- td/telegram/SecureManager.cpp | 2 +- td/telegram/StickersManager.cpp | 8 +-- td/telegram/Td.cpp | 4 +- td/telegram/WebPagesManager.cpp | 4 +- td/telegram/net/PublicRsaKeyWatchdog.cpp | 2 +- 9 files changed, 87 insertions(+), 84 deletions(-) diff --git a/td/telegram/BackgroundManager.cpp b/td/telegram/BackgroundManager.cpp index 76b40939e..d351e9d7d 100644 --- a/td/telegram/BackgroundManager.cpp +++ b/td/telegram/BackgroundManager.cpp @@ -66,7 +66,8 @@ class GetBackgroundQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for getBackground " << background_id_ << "/" << background_name_ << ": " << status; + LOG(INFO) << "Receive error for GetBackgroundQuery for " << background_id_ << "/" << background_name_ << ": " + << status; promise_.set_error(std::move(status)); } }; diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index df9f8d783..45ab1cfc4 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -363,7 +363,7 @@ class GetContactsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for getContacts: " << to_string(ptr); + LOG(INFO) << "Receive result for GetContactsQuery: " << to_string(ptr); td->contacts_manager_->on_get_contacts(std::move(ptr)); } @@ -391,7 +391,7 @@ class GetContactsStatusesQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!G()->is_expected_error(status)) { - LOG(ERROR) << "Receive error for getContactsStatuses: " << status; + LOG(ERROR) << "Receive error for GetContactsStatusesQuery: " << status; } } }; @@ -512,7 +512,7 @@ class ImportContactsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for importContacts: " << to_string(ptr); + LOG(INFO) << "Receive result for ImportContactsQuery: " << to_string(ptr); td->contacts_manager_->on_get_users(std::move(ptr->users_), "ImportContactsQuery"); for (auto &imported_contact : ptr->imported_) { @@ -835,7 +835,7 @@ class DeleteProfilePhotoQuery : public Td::ResultHandler { } auto result = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for deleteProfilePhoto " << format::as_array(result); + LOG(INFO) << "Receive result for DeleteProfilePhotoQuery: " << format::as_array(result); if (result.size() != 1u) { LOG(WARNING) << "Photo can't be deleted"; return on_error(id, Status::Error(7, "Photo can't be deleted")); @@ -875,7 +875,7 @@ class UpdateProfileQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - LOG(DEBUG) << "Receive result for updateProfile " << to_string(result_ptr.ok()); + LOG(DEBUG) << "Receive result for UpdateProfileQuery: " << to_string(result_ptr.ok()); td->contacts_manager_->on_get_user(result_ptr.move_as_ok(), "UpdateProfileQuery"); td->contacts_manager_->on_update_profile_success(flags_, first_name_, last_name_, about_); @@ -929,7 +929,7 @@ class UpdateUsernameQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - LOG(DEBUG) << "Receive result for updateUsername " << to_string(result_ptr.ok()); + LOG(DEBUG) << "Receive result for UpdateUsernameQuery: " << to_string(result_ptr.ok()); td->contacts_manager_->on_get_user(result_ptr.move_as_ok(), "UpdateUsernameQuery"); promise_.set_value(Unit()); } @@ -1043,7 +1043,7 @@ class UpdateChannelUsernameQuery : public Td::ResultHandler { } bool result = result_ptr.ok(); - LOG(DEBUG) << "Receive result for updateChannelUsername " << result; + LOG(DEBUG) << "Receive result for UpdateChannelUsernameQuery: " << result; if (!result) { return on_error(id, Status::Error(500, "Supergroup username is not updated")); } @@ -1092,7 +1092,7 @@ class SetChannelStickerSetQuery : public Td::ResultHandler { } bool result = result_ptr.ok(); - LOG(DEBUG) << "Receive result for setChannelStickerSet " << result; + LOG(DEBUG) << "Receive result for SetChannelStickerSetQuery: " << result; if (!result) { return on_error(id, Status::Error(500, "Supergroup sticker set not updated")); } @@ -1138,7 +1138,7 @@ class ToggleChannelSignaturesQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for toggleChannelSignatures: " << to_string(ptr); + LOG(INFO) << "Receive result for ToggleChannelSignaturesQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1183,7 +1183,7 @@ class ToggleChannelIsAllHistoryAvailableQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for togglePreHistoryHidden: " << to_string(ptr); + LOG(INFO) << "Receive result for TogglePreHistoryHiddenQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->on_update_channel_is_all_history_available(channel_id_, is_all_history_available_); @@ -1242,7 +1242,7 @@ class EditChatAboutQuery : public Td::ResultHandler { } bool result = result_ptr.ok(); - LOG(DEBUG) << "Receive result for editChatAbout " << result; + LOG(DEBUG) << "Receive result for EditChatAboutQuery: " << result; if (!result) { return on_error(id, Status::Error(500, "Chat description is not updated")); } @@ -1370,7 +1370,7 @@ class ToggleSlowModeQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for toggleSlowMode: " << to_string(ptr); + LOG(INFO) << "Receive result for ToggleSlowModeQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->on_update_channel_slow_mode_delay(channel_id_, slow_mode_delay_); @@ -1454,7 +1454,7 @@ class DeleteChannelQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for deleteChannel: " << to_string(ptr); + LOG(INFO) << "Receive result for DeleteChannelQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1485,7 +1485,7 @@ class AddChatUserQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for addChatUser: " << to_string(ptr); + LOG(INFO) << "Receive result for AddChatUserQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1557,7 +1557,7 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for exportChatInvite: " << to_string(ptr); + LOG(INFO) << "Receive result for ExportChatInviteQuery: " << to_string(ptr); td->contacts_manager_->on_get_chat_invite_link(chat_id_, std::move(ptr)); promise_.set_value(Unit()); @@ -1593,7 +1593,7 @@ class ExportChannelInviteLinkQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for exportChannelInvite: " << to_string(ptr); + LOG(INFO) << "Receive result for ExportChannelInviteQuery: " << to_string(ptr); td->contacts_manager_->on_get_channel_invite_link(channel_id_, std::move(ptr)); promise_.set_value(Unit()); @@ -1627,7 +1627,7 @@ class CheckDialogInviteLinkQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for checkChatInvite: " << to_string(ptr); + LOG(INFO) << "Receive result for CheckChatInviteQuery: " << to_string(ptr); td->contacts_manager_->on_get_dialog_invite_link_info(invite_link_, std::move(ptr), std::move(promise_)); } @@ -1659,7 +1659,7 @@ class ImportDialogInviteLinkQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for importChatInvite: " << to_string(ptr); + LOG(INFO) << "Receive result for ImportChatInviteQuery: " << to_string(ptr); auto dialog_ids = UpdatesManager::get_chat_dialog_ids(ptr.get()); if (dialog_ids.size() != 1u) { @@ -1697,7 +1697,7 @@ class DeleteChatUserQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for deleteChatUser: " << to_string(ptr); + LOG(INFO) << "Receive result for DeleteChatUserQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1731,7 +1731,7 @@ class JoinChannelQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for joinChannel: " << to_string(ptr); + LOG(INFO) << "Receive result for JoinChannelQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1767,7 +1767,7 @@ class InviteToChannelQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for inviteToChannel: " << to_string(ptr); + LOG(INFO) << "Receive result for InviteToChannelQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->invalidate_channel_full(channel_id_, false, false); @@ -1804,7 +1804,7 @@ class EditChannelAdminQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for editChannelAdmin: " << to_string(ptr); + LOG(INFO) << "Receive result for EditChannelAdminQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->invalidate_channel_full(channel_id_, false, false); @@ -1841,7 +1841,7 @@ class EditChannelBannedQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for editChannelBanned: " << to_string(ptr); + LOG(INFO) << "Receive result for EditChannelBannedQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->invalidate_channel_full(channel_id_, false, false); @@ -1877,7 +1877,7 @@ class LeaveChannelQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for leaveChannel: " << to_string(ptr); + LOG(INFO) << "Receive result for LeaveChannelQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1912,7 +1912,7 @@ class CanEditChannelCreatorQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(ERROR) << "Receive result for CanEditChannelCreator: " << to_string(ptr); + LOG(ERROR) << "Receive result for CanEditChannelCreatorQuery: " << to_string(ptr); promise_.set_error(Status::Error(500, "Server doesn't returned error")); } @@ -1951,7 +1951,7 @@ class EditChannelCreatorQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for editChannelCreator: " << to_string(ptr); + LOG(INFO) << "Receive result for EditChannelCreatorQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); td->contacts_manager_->invalidate_channel_full(channel_id_, false, false); @@ -1983,7 +1983,7 @@ class MigrateChatQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for migrateChat: " << to_string(ptr); + LOG(INFO) << "Receive result for MigrateChatQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -2023,7 +2023,7 @@ class GetCreatedPublicChannelsQuery : public Td::ResultHandler { } auto chats_ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetCreatedPublicChannelsQuery " << to_string(chats_ptr); + LOG(INFO) << "Receive result for GetCreatedPublicChannelsQuery: " << to_string(chats_ptr); int32 constructor_id = chats_ptr->get_id(); switch (constructor_id) { case telegram_api::messages_chats::ID: { @@ -2067,7 +2067,7 @@ class GetGroupsForDiscussionQuery : public Td::ResultHandler { } auto chats_ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetGroupsForDiscussionQuery " << to_string(chats_ptr); + LOG(INFO) << "Receive result for GetGroupsForDiscussionQuery: " << to_string(chats_ptr); int32 constructor_id = chats_ptr->get_id(); switch (constructor_id) { case telegram_api::messages_chats::ID: { @@ -2111,7 +2111,7 @@ class GetInactiveChannelsQuery : public Td::ResultHandler { } auto result = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetInactiveChannelsQuery " << to_string(result); + LOG(INFO) << "Receive result for GetInactiveChannelsQuery: " << to_string(result); // TODO use result->dates_ td->contacts_manager_->on_get_users(std::move(result->users_), "GetInactiveChannelsQuery"); td->contacts_manager_->on_get_inactive_channels(std::move(result->chats_)); @@ -2168,7 +2168,7 @@ class GetFullUserQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - LOG(DEBUG) << "Receive result for getFullUser " << to_string(result_ptr.ok()); + LOG(DEBUG) << "Receive result for GetFullUserQuery: " << to_string(result_ptr.ok()); td->contacts_manager_->on_get_user_full(result_ptr.move_as_ok()); promise_.set_value(Unit()); } @@ -2207,7 +2207,7 @@ class GetUserPhotosQuery : public Td::ResultHandler { auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetUserPhotosQuery " << to_string(ptr); + LOG(INFO) << "Receive result for GetUserPhotosQuery: " << to_string(ptr); int32 constructor_id = ptr->get_id(); if (constructor_id == telegram_api::photos_photos::ID) { auto photos = move_tl_object_as(ptr); @@ -2328,7 +2328,7 @@ class GetChannelsQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - // LOG(INFO) << "Receive result for getChannels query: " << to_string(result_ptr.ok()); + // LOG(INFO) << "Receive result for GetChannelsQuery query: " << to_string(result_ptr.ok()); auto chats_ptr = result_ptr.move_as_ok(); int32 constructor_id = chats_ptr->get_id(); switch (constructor_id) { diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index c495e5929..bb22688c9 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -938,7 +938,7 @@ class CreateChatQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for createChat " << to_string(ptr); + LOG(INFO) << "Receive result for CreateChatQuery: " << to_string(ptr); td->messages_manager_->on_create_new_dialog_success(random_id_, std::move(ptr), DialogType::Chat, std::move(promise_)); } @@ -981,7 +981,7 @@ class CreateChannelQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for createChannel " << to_string(ptr); + LOG(INFO) << "Receive result for CreateChannelQuery: " << to_string(ptr); td->messages_manager_->on_create_new_dialog_success(random_id_, std::move(ptr), DialogType::Channel, std::move(promise_)); } @@ -1037,7 +1037,7 @@ class EditDialogPhotoQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for EditDialogPhoto: " << to_string(ptr); + LOG(INFO) << "Receive result for EditDialogPhotoQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); if (file_id_.is_valid() && was_uploaded_) { @@ -1113,7 +1113,7 @@ class EditDialogTitleQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for EditDialogTitle: " << to_string(ptr); + LOG(INFO) << "Receive result for EditDialogTitleQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1157,7 +1157,7 @@ class EditDialogDefaultBannedRightsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for EditDialogPermissions: " << to_string(ptr); + LOG(INFO) << "Receive result for EditDialogPermissionsQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -1259,7 +1259,7 @@ class ClearAllDraftsQuery : public Td::ResultHandler { bool result = result_ptr.move_as_ok(); if (!result) { - LOG(INFO) << "Receive false for clearAllDrafts"; + LOG(INFO) << "Receive false for ClearAllDraftsQuery"; } else { LOG(INFO) << "All draft messages has been cleared"; } @@ -1706,7 +1706,7 @@ class GetHistoryQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!td->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetHistoryQuery")) { - LOG(ERROR) << "Receive error for getHistoryQuery in " << dialog_id_ << ": " << status; + LOG(ERROR) << "Receive error for GetHistoryQuery in " << dialog_id_ << ": " << status; } promise_.set_error(std::move(status)); } @@ -1736,7 +1736,7 @@ class ReadHistoryQuery : public Td::ResultHandler { auto affected_messages = result_ptr.move_as_ok(); CHECK(affected_messages->get_id() == telegram_api::messages_affectedMessages::ID); - LOG(INFO) << "Receive result for readHistory: " << to_string(affected_messages); + LOG(INFO) << "Receive result for ReadHistoryQuery: " << to_string(affected_messages); if (affected_messages->pts_count_ > 0) { td->messages_manager_->add_pending_update(make_tl_object(), affected_messages->pts_, @@ -1748,7 +1748,7 @@ class ReadHistoryQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!td->messages_manager_->on_get_dialog_error(dialog_id_, status, "ReadHistoryQuery")) { - LOG(ERROR) << "Receive error for readHistory: " << status; + LOG(ERROR) << "Receive error for ReadHistoryQuery: " << status; } promise_.set_error(std::move(status)); } @@ -1782,7 +1782,7 @@ class ReadChannelHistoryQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!td->contacts_manager_->on_get_channel_error(channel_id_, status, "ReadChannelHistoryQuery")) { - LOG(ERROR) << "Receive error for readChannelHistory: " << status; + LOG(ERROR) << "Receive error for ReadChannelHistoryQuery: " << status; } promise_.set_error(std::move(status)); } @@ -2233,7 +2233,7 @@ class DeleteChannelHistoryQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!td->contacts_manager_->on_get_channel_error(channel_id_, status, "DeleteChannelHistoryQuery")) { - LOG(ERROR) << "Receive error for deleteChannelHistory: " << status; + LOG(ERROR) << "Receive error for DeleteChannelHistoryQuery: " << status; } promise_.set_error(std::move(status)); } @@ -2268,7 +2268,7 @@ class BlockFromRepliesQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for BlockFromReplies: " << to_string(ptr); + LOG(INFO) << "Receive result for BlockFromRepliesQuery: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); @@ -2496,7 +2496,7 @@ class SendMessageActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for sendMessage for " << random_id_ << ": " << to_string(ptr); + LOG(INFO) << "Receive result for SendMessageQuery for " << random_id_ << ": " << to_string(ptr); auto constructor_id = ptr->get_id(); if (constructor_id != telegram_api::updateShortSentMessage::ID) { @@ -2521,7 +2521,7 @@ class SendMessageActor : public NetActorOnce { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for sendMessage: " << status; + LOG(INFO) << "Receive error for SendMessageQuery: " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message will be re-sent return; @@ -2564,14 +2564,14 @@ class StartBotQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for startBot for " << random_id_ << ": " << to_string(ptr); + LOG(INFO) << "Receive result for StartBotQuery for " << random_id_ << ": " << to_string(ptr); // Result may contain messageActionChatAddUser // td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "StartBot"); td->updates_manager_->on_get_updates(std::move(ptr)); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for startBot: " << status; + LOG(INFO) << "Receive error for StartBotQuery: " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message should be re-sent return; @@ -2609,13 +2609,13 @@ class SendInlineBotResultQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for sendInlineBotResult for " << random_id_ << ": " << to_string(ptr); + LOG(INFO) << "Receive result for SendInlineBotResultQuery for " << random_id_ << ": " << to_string(ptr); td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "SendInlineBotResult"); td->updates_manager_->on_get_updates(std::move(ptr)); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for sendInlineBotResult: " << status; + LOG(INFO) << "Receive error for SendInlineBotResultQuery: " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message will be re-sent return; @@ -2667,7 +2667,8 @@ class SendMultiMediaActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for sendMultiMedia for " << format::as_array(random_ids_) << ": " << to_string(ptr); + LOG(INFO) << "Receive result for SendMultiMediaQuery for " << format::as_array(random_ids_) << ": " + << to_string(ptr); auto sent_random_ids = UpdatesManager::get_sent_messages_random_ids(ptr.get()); bool is_result_wrong = false; @@ -2698,7 +2699,7 @@ class SendMultiMediaActor : public NetActorOnce { } } if (is_result_wrong) { - LOG(ERROR) << "Receive wrong result for sendMultiMedia with random_ids " << format::as_array(random_ids_) + LOG(ERROR) << "Receive wrong result for SendMultiMediaQuery with random_ids " << format::as_array(random_ids_) << " to " << dialog_id_ << ": " << oneline(to_string(ptr)); td->updates_manager_->schedule_get_difference("Wrong sendMultiMedia result"); } @@ -2707,7 +2708,7 @@ class SendMultiMediaActor : public NetActorOnce { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for sendMultiMedia: " << status; + LOG(INFO) << "Receive error for SendMultiMediaQuery: " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message will be re-sent return; @@ -2795,13 +2796,13 @@ class SendMediaActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for sendMedia for " << random_id_ << ": " << to_string(ptr); + LOG(INFO) << "Receive result for SendMediaQuery for " << random_id_ << ": " << to_string(ptr); td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "SendMedia"); td->updates_manager_->on_get_updates(std::move(ptr)); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for sendMedia: " << status; + LOG(INFO) << "Receive error for SendMediaQuery: " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message will be re-sent return; @@ -2883,12 +2884,13 @@ class UploadMediaQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for uploadMedia for " << message_id_ << " in " << dialog_id_ << ": " << to_string(ptr); + LOG(INFO) << "Receive result for UploadMediaQuery for " << message_id_ << " in " << dialog_id_ << ": " + << to_string(ptr); td->messages_manager_->on_upload_message_media_success(dialog_id_, message_id_, std::move(ptr)); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for uploadMedia for " << message_id_ << " in " << dialog_id_ << ": " << status; + LOG(INFO) << "Receive error for UploadMediaQuery for " << message_id_ << " in " << dialog_id_ << ": " << status; if (G()->close_flag() && G()->parameters().use_message_db) { // do not send error, message will be re-sent return; @@ -2954,14 +2956,14 @@ class SendScheduledMessageActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for SendScheduledMessage: " << to_string(ptr); + LOG(INFO) << "Receive result for SendScheduledMessageActor: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for SendScheduledMessage: " << status; + LOG(INFO) << "Receive error for SendScheduledMessageActor: " << status; td->messages_manager_->on_get_dialog_error(dialog_id_, status, "SendScheduledMessageActor"); promise_.set_error(std::move(status)); } @@ -3030,14 +3032,14 @@ class EditMessageActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for EditMessage: " << to_string(ptr); + LOG(INFO) << "Receive result for EditMessageActor: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for editMessage: " << status; + LOG(INFO) << "Receive error for EditMessageQuery: " << status; if (!td->auth_manager_->is_bot() && status.message() == "MESSAGE_NOT_MODIFIED") { return promise_.set_value(Unit()); } @@ -3097,7 +3099,7 @@ class EditInlineMessageQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for editInlineMessage: " << status; + LOG(INFO) << "Receive error for EditInlineMessageQuery: " << status; promise_.set_error(std::move(status)); } }; @@ -3148,14 +3150,14 @@ class SetGameScoreActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for SetGameScore: " << to_string(ptr); + LOG(INFO) << "Receive result for SetGameScoreActor: " << to_string(ptr); td->updates_manager_->on_get_updates(std::move(ptr)); promise_.set_value(Unit()); } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for setGameScore: " << status; + LOG(INFO) << "Receive error for SetGameScoreQuery: " << status; td->messages_manager_->on_get_dialog_error(dialog_id_, status, "SetGameScoreActor"); promise_.set_error(std::move(status)); } @@ -3201,7 +3203,7 @@ class SetInlineGameScoreQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for setInlineGameScore: " << status; + LOG(INFO) << "Receive error for SetInlineGameScoreQuery: " << status; promise_.set_error(std::move(status)); } }; @@ -3239,7 +3241,7 @@ class GetGameHighScoresQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for getGameHighScores: " << status; + LOG(INFO) << "Receive error for GetGameHighScoresQuery: " << status; td->messages_manager_->on_get_game_high_scores(random_id_, nullptr); td->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetGameHighScoresQuery"); promise_.set_error(std::move(status)); @@ -3278,7 +3280,7 @@ class GetInlineGameHighScoresQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for getInlineGameHighScores: " << status; + LOG(INFO) << "Receive error for GetInlineGameHighScoresQuery: " << status; td->messages_manager_->on_get_game_high_scores(random_id_, nullptr); promise_.set_error(std::move(status)); } @@ -3338,7 +3340,8 @@ class ForwardMessagesActor : public NetActorOnce { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for forwardMessages for " << format::as_array(random_ids_) << ": " << to_string(ptr); + LOG(INFO) << "Receive result for ForwardMessagesQuery for " << format::as_array(random_ids_) << ": " + << to_string(ptr); auto sent_random_ids = UpdatesManager::get_sent_messages_random_ids(ptr.get()); bool is_result_wrong = false; auto sent_random_ids_size = sent_random_ids.size(); @@ -3584,7 +3587,7 @@ class DeleteChannelMessagesQuery : public Td::ResultHandler { } auto affected_messages = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for deleteChannelMessages: " << to_string(affected_messages); + LOG(INFO) << "Receive result for DeleteChannelMessagesQuery: " << to_string(affected_messages); CHECK(affected_messages->get_id() == telegram_api::messages_affectedMessages::ID); if (affected_messages->pts_count_ > 0) { @@ -4342,7 +4345,7 @@ class ResolveUsernameQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(DEBUG) << "Receive result for resolveUsername " << to_string(ptr); + LOG(DEBUG) << "Receive result for ResolveUsernameQuery: " << to_string(ptr); td->contacts_manager_->on_get_users(std::move(ptr->users_), "ResolveUsernameQuery"); td->contacts_manager_->on_get_chats(std::move(ptr->chats_), "ResolveUsernameQuery"); @@ -12013,7 +12016,6 @@ void MessagesManager::ttl_db_on_result(Result promise) { promise.set_value(Unit()); // TODO: set after error is saved - LOG(INFO) << "Receive error for SecretChatsManager::send_message: " << error; auto it = being_sent_messages_.find(random_id); if (it != being_sent_messages_.end()) { diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index 42ca81e54..82f6e650d 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -223,7 +223,7 @@ class StopPollActor : public NetActorOnce { } auto result = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for stopPoll: " << to_string(result); + LOG(INFO) << "Receive result for StopPollQuery: " << to_string(result); td->updates_manager_->on_get_updates(std::move(result)); promise_.set_value(Unit()); diff --git a/td/telegram/SecureManager.cpp b/td/telegram/SecureManager.cpp index accd573a0..c0a7d9aa0 100644 --- a/td/telegram/SecureManager.cpp +++ b/td/telegram/SecureManager.cpp @@ -146,7 +146,7 @@ class SetSecureValueErrorsQuery : public Td::ResultHandler { } bool ptr = result_ptr.move_as_ok(); - LOG(DEBUG) << "Receive result for SetSecureValueErrorsQuery " << ptr; + LOG(DEBUG) << "Receive result for SetSecureValueErrorsQuery: " << ptr; promise_.set_value(Unit()); } diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 3e0a09085..13a3055cb 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -260,7 +260,7 @@ class GetArchivedStickerSetsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetArchivedStickerSetsQuery " << to_string(ptr); + LOG(INFO) << "Receive result for GetArchivedStickerSetsQuery: " << to_string(ptr); td->stickers_manager_->on_get_archived_sticker_sets(is_masks_, offset_sticker_set_id_, std::move(ptr->sets_), ptr->count_); @@ -286,7 +286,7 @@ class GetFeaturedStickerSetsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(DEBUG) << "Receive result for GetFeaturedStickerSetsQuery " << to_string(ptr); + LOG(DEBUG) << "Receive result for GetFeaturedStickerSetsQuery: " << to_string(ptr); td->stickers_manager_->on_get_featured_sticker_sets(-1, -1, 0, std::move(ptr)); } @@ -316,7 +316,7 @@ class GetOldFeaturedStickerSetsQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(DEBUG) << "Receive result for GetOldFeaturedStickerSetsQuery " << to_string(ptr); + LOG(DEBUG) << "Receive result for GetOldFeaturedStickerSetsQuery: " << to_string(ptr); td->stickers_manager_->on_get_featured_sticker_sets(offset_, limit_, generation_, std::move(ptr)); } @@ -690,7 +690,7 @@ class GetStickerSetQuery : public Td::ResultHandler { } void on_error(uint64 id, Status status) override { - LOG(INFO) << "Receive error for getStickerSet: " << status; + LOG(INFO) << "Receive error for GetStickerSetQuery: " << status; td->stickers_manager_->on_load_sticker_set_fail(sticker_set_id_, status); promise_.set_error(std::move(status)); } diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 03a8a1816..a4882aeed 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -360,7 +360,7 @@ class SetBotUpdatesStatusQuery : public Td::ResultHandler { void on_error(uint64 id, Status status) override { if (!G()->is_expected_error(status)) { - LOG(WARNING) << "Receive error for SetBotUpdatesStatus: " << status; + LOG(WARNING) << "Receive error for SetBotUpdatesStatusQuery: " << status; } status.ignore(); } @@ -3155,7 +3155,7 @@ void Td::on_get_promo_data(Resultweb_pages_manager_->on_get_web_page_preview_success(request_id_, url_, std::move(ptr), std::move(promise_)); } @@ -112,7 +112,7 @@ class GetWebPageQuery : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetWebPageQuery " << to_string(ptr); + LOG(INFO) << "Receive result for GetWebPageQuery: " << to_string(ptr); if (ptr->get_id() == telegram_api::webPageNotModified::ID) { if (web_page_id_.is_valid()) { auto web_page = move_tl_object_as(ptr); diff --git a/td/telegram/net/PublicRsaKeyWatchdog.cpp b/td/telegram/net/PublicRsaKeyWatchdog.cpp index 08a6af66a..a89295efc 100644 --- a/td/telegram/net/PublicRsaKeyWatchdog.cpp +++ b/td/telegram/net/PublicRsaKeyWatchdog.cpp @@ -77,7 +77,7 @@ void PublicRsaKeyWatchdog::on_result(NetQueryPtr net_query) { has_query_ = false; yield(); if (net_query->is_error()) { - LOG(ERROR) << "Receive error for getCdnConfig: " << net_query->move_as_error(); + LOG(ERROR) << "Receive error for GetCdnConfigQuery: " << net_query->move_as_error(); return; }