chore: Simple log filter script - #208
Conversation
📝 WalkthroughWalkthroughAdds a new CLI Python script that filters NDJSON log records by ISO-like timestamps extracted from each record's Changes
Sequence DiagramsequenceDiagram
participant User
participant CLI as Argument Parser
participant TZ as Timezone Resolver
participant Reader as NDJSON Reader
participant Parser as Text Timestamp Parser
participant Filter as Range Filter
participant Writer as Output Writer
participant Stats as Stats Reporter
User->>CLI: invoke with args (--start,--end,--tz,...)
CLI->>TZ: resolve timezone (UTC or LOCAL)
CLI->>Reader: open input file and pass params
loop per line
Reader->>Parser: parse JSON, extract `text`, match `TEXT_TS_RE`
Parser->>Filter: return datetime or None
Filter->>Writer: if in range -> write line
alt invalid and --keep-invalid
Filter->>Writer: write line
end
end
alt --stats
Writer->>Stats: provide counts
Stats->>User: emit stats to stderr
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🪛 Ruff (0.14.11)openrag/scripts/filter-logs.py50-50: Avoid specifying long messages outside the exception class (TRY003) 76-76: Avoid specifying long messages outside the exception class (TRY003) 82-82: Avoid specifying long messages outside the exception class (TRY003) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (6)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c260d30 to
241eada
Compare
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.