Skip to content

feat(#28): Add log rotation, stats command, and logging documentation - #53

Merged
admarble merged 3 commits into
mainfrom
feature/28-logging-enhancements-rotation-stats-and-documentat
Jan 10, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/28-logging-enhancements-rotation-stats-and-documentat

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Log Rotation: Automatic rotation when .sequant/logs/ exceeds 10MB or 100 files with 10% buffer to prevent immediate re-rotation
  • Stats Command: New sequant stats command with success/failure rates, phase durations, and common failure patterns
  • Documentation: Comprehensive docs/logging.md with JSON schema reference and jq examples

Test Plan

  • All 213 unit tests pass including 16 new rotation tests and 9 new stats tests
  • Build succeeds without errors
  • Manual test: sequant logs --rotate --dry-run shows rotation preview
  • Manual test: sequant stats shows aggregate statistics
  • Manual test: sequant stats --csv outputs valid CSV

Acceptance Criteria

AC Description Status
AC-1 Log rotation when size exceeds 10MB ✅
AC-2 Log rotation when file count exceeds 100 ✅
AC-3 --rotate CLI flag for manual rotation ✅
AC-4 sequant stats command with aggregate analysis ✅
AC-5 CSV export option for stats ✅
AC-6 Document logging system in docs/logging.md ✅
AC-7 Document JSON log schema for external tooling ✅
AC-8 Provide working jq examples ✅

Closes #28

🤖 Generated with Claude Code

- Add log rotation when .sequant/logs/ exceeds 10MB or 100 files (AC-1, AC-2)
- Add --rotate flag to sequant logs with --dry-run support (AC-3)
- Add sequant stats command with aggregate analysis (AC-4)
- Add CSV export with --csv flag for stats (AC-5)
- Add docs/logging.md with system overview (AC-6)
- Document JSON log schema with TypeScript interfaces (AC-7)
- Include working jq examples for log parsing (AC-8)

Rotation is enabled by default with a 10% buffer (stops at 90% of threshold)
to prevent immediate re-rotation. Auto-rotation runs after LogWriter.finalize().

Co-Authored-By: Claude Opus 4.5 <[email protected]>
admarble and others added 2 commits January 10, 2026 11:13
- Log rotation with size/count thresholds
- sequant stats command with CSV/JSON export
- docs/logging.md with schema reference and jq examples

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…hancements-rotation-stats-and-documentat

# Conflicts:
#	CHANGELOG.md
@admarble
admarble merged commit 7bbc47f into main Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logging enhancements: rotation, stats, and documentation

1 participant