Don't dump trace on Watchdog timeouts if log is disabled.

This commit is contained in:
levlam 2023-03-27 19:05:23 +03:00
parent df53cfeb85
commit 0e5673f2dc

View File

@ -13,7 +13,7 @@ namespace telegram_bot_api {
void Watchdog::kick() {
auto now = td::Time::now();
if (now >= last_kick_time_ + timeout_ && last_kick_time_ > 0) {
if (now >= last_kick_time_ + timeout_ && last_kick_time_ > 0 && GET_VERBOSITY_LEVEL() >= VERBOSITY_NAME(ERROR)) {
LOG(ERROR) << get_name() << " timeout expired after " << now - last_kick_time_ << " seconds";
td::thread::send_real_time_signal(main_thread_id_, 2);
}