From d8808656856b6baffca6f2d6ee93100063b6faff Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 23 Jun 2020 01:02:46 +0300 Subject: [PATCH] Improve logging. GitOrigin-RevId: d9d4ff3eb325318676f44579b7d410e7a5b1cdd8 --- td/telegram/LanguagePackManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/td/telegram/LanguagePackManager.cpp b/td/telegram/LanguagePackManager.cpp index 463241263..fcb4011c5 100644 --- a/td/telegram/LanguagePackManager.cpp +++ b/td/telegram/LanguagePackManager.cpp @@ -403,13 +403,19 @@ void LanguagePackManager::on_update_language_pack(tl_object_ptrfrom_version_ << " with version " << difference->version_ << " of size " << difference->strings_.size(); to_lower_inplace(difference->lang_code_); + if (language_code_.empty()) { + LOG(INFO) << "Ignore difference for language pack " << difference->lang_code_ + << ", because have no used language pack"; + return; + } if (language_pack_.empty()) { LOG(WARNING) << "Ignore difference for language pack " << difference->lang_code_ - << ", because used language pack was unset"; + << ", because localization target is not set"; return; } if (difference->lang_code_ != language_code_ && difference->lang_code_ != base_language_code_) { - LOG(WARNING) << "Ignore difference for language pack " << difference->lang_code_; + LOG(WARNING) << "Ignore difference for language pack " << difference->lang_code_ << ", because using language pack " + << language_code_ << " based on " << base_language_code_; return; } if (is_custom_language_code(difference->lang_code_) || difference->lang_code_.empty()) {