From 0e5673f2dce75805d96d3cb225414e7aef1b7d63 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 27 Mar 2023 19:05:23 +0300 Subject: [PATCH] Don't dump trace on Watchdog timeouts if log is disabled. --- telegram-bot-api/Watchdog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram-bot-api/Watchdog.cpp b/telegram-bot-api/Watchdog.cpp index 1bb15e6..9b5c88d 100644 --- a/telegram-bot-api/Watchdog.cpp +++ b/telegram-bot-api/Watchdog.cpp @@ -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); }