feat: add logging for raw event index bytes and decoded count in event count decoder

This commit is contained in:
Brian Harrison
2026-04-03 15:28:51 -04:00
parent f495b91d8a
commit 7cd8fda5e8

View File

@@ -475,6 +475,12 @@ def _decode_event_count(data: bytes) -> int:
log.warning("event index payload too short (%d bytes), assuming 0 events", len(data)) log.warning("event index payload too short (%d bytes), assuming 0 events", len(data))
return 0 return 0
# Log the raw bytes so we can verify this decode against known event counts
log.warning(
"event_index raw (first 16 bytes): %s",
" ".join(f"{b:02x}" for b in data[:16]),
)
# Try the uint32 at +3 first # Try the uint32 at +3 first
count = struct.unpack_from(">I", data, 3)[0] count = struct.unpack_from(">I", data, 3)[0]
@@ -485,6 +491,7 @@ def _decode_event_count(data: bytes) -> int:
) )
return 0 return 0
log.warning("event_index decoded count=%d (uint32 BE at offset +3)", count)
return count return count