From 07619ff4a836517f670b95b698c25e4425a71581 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 26 Aug 2023 07:42:57 +0200 Subject: [PATCH] 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. --- src/trackbert/trackers/keydelivery.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trackbert/trackers/keydelivery.py b/src/trackbert/trackers/keydelivery.py index 5588b8a..8fb468f 100644 --- a/src/trackbert/trackers/keydelivery.py +++ b/src/trackbert/trackers/keydelivery.py @@ -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(