浏览代码

express: Protect clock debug print with is_debug() check

rdb 4 年之前
父节点
当前提交
32b78a382a
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      panda/src/express/trueClock.cxx

+ 6 - 4
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