Description
Currently lifecycle events (BORN, LOST, DEAD) are only printed to the console.
Add a structured JSONL logger that appends lifecycle events into:
Each event should be stored as one JSON object per line so events can later
be replayed, inspected, or analyzed offline.
Example Output
{"event":"BORN","track_id":3,"frame_id":0,"zones":["restricted_door"],"timestamp_ms":1718000000000}
{"event":"DEAD","track_id":3,"frame_id":900,"dwell_time_seconds":30.1,"timestamp_ms":1718000030000}
Files to Touch
libs/utils/lifecycle_logger.py
services/tracking/tracker.py
tests/test_lifecycle_logger.py
Implementation Notes
-
Create reusable helper:
lifecycle_logger.log(event)
-
Call logger inside _emit_lifecycle()
-
Logger should append safely without overwriting previous events
-
Support configurable path via:
Acceptance Criteria
Description
Currently lifecycle events (
BORN,LOST,DEAD) are only printed to the console.Add a structured JSONL logger that appends lifecycle events into:
Each event should be stored as one JSON object per line so events can later
be replayed, inspected, or analyzed offline.
Example Output
{"event":"BORN","track_id":3,"frame_id":0,"zones":["restricted_door"],"timestamp_ms":1718000000000} {"event":"DEAD","track_id":3,"frame_id":900,"dwell_time_seconds":30.1,"timestamp_ms":1718000030000}Files to Touch
Implementation Notes
Create reusable helper:
Call logger inside
_emit_lifecycle()Logger should append safely without overwriting previous events
Support configurable path via:
Acceptance Criteria