Fix logging error when getting events for a tracking number

Previously, an error message was printed using print() function. This is now changed to use logging.error() to properly log the error.
This commit is contained in:
Kumi 2023-08-26 07:42:57 +02:00
parent edb021536e
commit 07619ff4a8
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -19,7 +19,8 @@ class KeyDelivery(BaseTracker):
f"Got events for {tracking_number}: {len(all_events['data']['items'])}"
)
except KeyError:
print(f"Error getting events for {tracking_number}: {all_events}")
logging.error(
f"Error getting events for {tracking_number}: {all_events}")
return
events = sorted(