From 01ee58bd276deba828d619fbfc3ac4fa8220c973 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 4 Dec 2024 17:31:44 +0300 Subject: [PATCH] Log if failed to get CPU statistics on supported platforms. --- telegram-bot-api/Stats.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram-bot-api/Stats.cpp b/telegram-bot-api/Stats.cpp index 2190644..94876b6 100644 --- a/telegram-bot-api/Stats.cpp +++ b/telegram-bot-api/Stats.cpp @@ -23,6 +23,9 @@ ServerCpuStat::ServerCpuStat() { void ServerCpuStat::update(double now) { auto r_cpu_stat = td::cpu_stat(); if (r_cpu_stat.is_error()) { + if (r_cpu_stat.error().message() != "Not supported") { + LOG(ERROR) << "Failed to get CPU statistics: " << r_cpu_stat.error(); + } return; }