From 34d56b45bb5edef747018f3fa8cb059877a1b0df Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Mon, 20 Jan 2025 16:00:12 +0100 Subject: [PATCH] Silence debug print statements and use cloudlog for warnings. Commented out a debug print statement in `commonmodel.cc` to reduce noise. Replaced `print` statements with `cloudlog.warning` in `model_smart_input.py` for improved logging consistency and better integration with the logging system. --- selfdrive/modeld/models/commonmodel.cc | 2 +- sunnypilot/modeld_v2/model_smart_input.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/modeld/models/commonmodel.cc b/selfdrive/modeld/models/commonmodel.cc index 7870363b80..0dcb1e5407 100644 --- a/selfdrive/modeld/models/commonmodel.cc +++ b/selfdrive/modeld/models/commonmodel.cc @@ -12,7 +12,7 @@ DrivingModelFrame::DrivingModelFrame(cl_device_id device_id, cl_context context, region.origin = (buffer_length - 1) * frame_size_bytes; region.size = frame_size_bytes; last_img_cl = CL_CHECK_ERR(clCreateSubBuffer(img_buffer_20hz_cl, CL_MEM_READ_WRITE, CL_BUFFER_CREATE_TYPE_REGION, ®ion, &err)); - printf("Buffer length: %d, region origin: %lu, region size: %lu\n", buffer_length, region.origin, region.size); + // printf("Buffer length: %d, region origin: %lu, region size: %lu\n", buffer_length, region.origin, region.size); loadyuv_init(&loadyuv, context, device_id, MODEL_WIDTH, MODEL_HEIGHT); init_transform(device_id, context, MODEL_WIDTH, MODEL_HEIGHT); diff --git a/sunnypilot/modeld_v2/model_smart_input.py b/sunnypilot/modeld_v2/model_smart_input.py index a3b6c45e3f..5d3bfd9490 100644 --- a/sunnypilot/modeld_v2/model_smart_input.py +++ b/sunnypilot/modeld_v2/model_smart_input.py @@ -1,5 +1,6 @@ import pickle from abc import abstractmethod, ABC +from openpilot.common.swaglog import cloudlog import numpy as np @@ -58,7 +59,7 @@ class ModelSmartInput(ABC): def input_shapes(self, value): if not self._input_shapes: self._input_shapes = value - print("Waring: ignoring input_shapes setter because ModelSmartInput is in use.") + cloudlog.warning("Ignoring input_shapes setter because ModelSmartInput is in use.") @property def output_slices(self): @@ -68,7 +69,7 @@ class ModelSmartInput(ABC): def output_slices(self, value): if not self._output_slices: self._output_slices = value - print("Waring: ignoring output_slices setter because ModelSmartInput is in use.") + cloudlog.warning("Ignoring output_slices setter because ModelSmartInput is in use.") @property @abstractmethod @@ -83,4 +84,4 @@ class ModelSmartInput(ABC): def numpy_inputs(self, value): if not self._numpy_inputs: self._numpy_inputs = value - print("Waring: ignoring numpy_inputs setter because ModelSmartInput is in use.") + cloudlog.warning("Ignoring numpy_inputs setter because ModelSmartInput is in use.")