Update debug logs with latest known and upstream events

Updated debug logs in the `start_loop` function to include the latest known event for a tracking number and the latest upstream event with their respective timestamps. This provides more detailed information for debugging purposes.
This commit is contained in:
Kumi 2023-08-21 09:01:32 +02:00
parent 33721e4939
commit 053ae780e1
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -223,7 +223,7 @@ def start_loop(db: sqlite3.Connection, api: KeyDelivery) -> Never:
events = sorted(all_events["data"]["items"], key=lambda x: x["time"], reverse=True)
logging.debug(f"Latest known event for {tracking_number}: {latest_known_event[3]}")
logging.debug(f"Latest known event for {tracking_number}: {latest_known_event[3]} - {latest_known_event[2]}")
logging.debug(f"Latest upstream event for {tracking_number}: {events[0]['context']} - {events[0]['time']}")
for event in events: