Stop using print statments or root level loggers

This commit is contained in:
Julian Stirling 2025-09-18 14:30:44 +01:00
parent 338d49f9e6
commit 65f172d650
9 changed files with 69 additions and 52 deletions

View file

@ -25,6 +25,8 @@ from .camera import RawCameraDependency as RawCamera
from .camera import CameraDependency as CameraClient
from .stage import StageDependency as Stage
LOGGER = logging.getLogger(__name__)
class NotStreamingError(RuntimeError):
"""No images captured from stream. The camera is almost certainly not streaming."""
@ -228,7 +230,7 @@ class JPEGSharpnessMonitor:
self.camera = camera
self.stage = stage
self.portal = portal
print(f"Created sharpness monitor with {stage}, {camera}, {portal}")
LOGGER.debug(f"Created sharpness monitor with {stage}, {camera}, {portal}")
self.stage_positions: list[Mapping[str, int]] = []
self.stage_times: list[float] = []
self.jpeg_times: list[float] = []
@ -307,7 +309,7 @@ class JPEGSharpnessMonitor:
raise e
if stop < 1:
stop = len(jpeg_times)
logging.debug("changing stop to %s", (stop))
LOGGER.debug("changing stop to %s", (stop))
jpeg_times = jpeg_times[start:stop]
jpeg_heights: np.ndarray = np.interp(jpeg_times, stage_times, stage_heights)
return jpeg_times, jpeg_heights, jpeg_sizes[start:stop]