From 32b78a382a7659c56a019acecda5039a715b36e0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Aug 2021 14:00:59 +0200 Subject: [PATCH] express: Protect clock debug print with is_debug() check --- panda/src/express/trueClock.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/src/express/trueClock.cxx b/panda/src/express/trueClock.cxx index f60ddc22dc..3f7d66bc60 100644 --- a/panda/src/express/trueClock.cxx +++ b/panda/src/express/trueClock.cxx @@ -243,10 +243,12 @@ correct_time(double time) { // backward in the high-precision clock, since this does appear to happen // in a threaded environment. - clock_cat.debug() - << "Clock error detected; elapsed time " << time_delta - << "s on high-resolution counter, and " << tod_delta - << "s on time-of-day clock.\n"; + if (clock_cat.is_debug()) { + clock_cat.debug() + << "Clock error detected; elapsed time " << time_delta + << "s on high-resolution counter, and " << tod_delta + << "s on time-of-day clock.\n"; + } ++_error_count; // If both are negative, we call it 0. If one is negative, we trust the