From 23faff1da732ca7ad35da96fdea73d2d6ccf2e94 Mon Sep 17 00:00:00 2001 From: Doug Boulware Date: Thu, 14 Mar 2024 16:29:07 -0600 Subject: [PATCH] Add logging. --- scos_actions/calibration/sensor_calibration.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scos_actions/calibration/sensor_calibration.py b/scos_actions/calibration/sensor_calibration.py index 7ccdb03f..f2f66718 100644 --- a/scos_actions/calibration/sensor_calibration.py +++ b/scos_actions/calibration/sensor_calibration.py @@ -93,6 +93,7 @@ def update( def expired(self) -> bool: env = Env() time_limit = env.int("CALIBRATION_EXPIRATION_LIMIT", default=None) + logger.debug("Checking if calibration has expired.") if time_limit is None: return False elif self.calibration_data is None: @@ -121,5 +122,8 @@ def date_expired(cal_data: dict, now: datetime, time_limit: int): cal_datetime = parse_datetime_iso_format_str(cal_data["datetime"]) elapsed = now - cal_datetime if elapsed.total_seconds() > time_limit: + logger.debug( + f"Calibration {cal_data} has expired at {elapsed.total_seconds()} seconds old." + ) return True return False