Improve logging.

This commit is contained in:
levlam 2022-09-02 13:48:06 +03:00
parent 0974a8c17e
commit e212d9c62a
2 changed files with 7 additions and 3 deletions

View File

@ -11805,13 +11805,13 @@ void ContactsManager::on_update_user_emoji_status(UserId user_id,
on_update_user_emoji_status(u, user_id, EmojiStatus(std::move(emoji_status)));
update_user(u, user_id);
} else {
LOG(INFO) << "Ignore update user emoji status about unknown " << user_id;
LOG(INFO) << "Ignore update user premium status about unknown " << user_id;
}
}
void ContactsManager::on_update_user_emoji_status(User *u, UserId user_id, EmojiStatus emoji_status) {
if (u->emoji_status != emoji_status) {
LOG(DEBUG) << "Change emoji status of " << user_id << " from " << u->emoji_status << " to " << emoji_status;
LOG(DEBUG) << "Change premium status of " << user_id << " from " << u->emoji_status << " to " << emoji_status;
u->emoji_status = emoji_status;
}
}

View File

@ -38,9 +38,13 @@ struct EmojiStatuses {
for (auto &status : emoji_statuses->statuses_) {
EmojiStatus emoji_status(std::move(status));
if (emoji_status.is_empty()) {
LOG(ERROR) << "Receive empty emoji status";
LOG(ERROR) << "Receive empty premium status";
continue;
}
if (emoji_status.get_until_date() != 0) {
LOG(ERROR) << "Receive temporary premium status";
emoji_status.clear_until_date();
}
emoji_statuses_.push_back(emoji_status);
}
}