15SystemsPython 3.10+ · stdlib only · text & JSON output
Log Analyzer
A dependency-free CLI that reads any log, counts events by severity level, pulls out the error lines and hands back a structured report in text or JSON — the parse-and-classify stage of log analysis with nothing configured.
Open source on GitHub
The parse before the visualise
Log analysis is the foundation of observability, and it starts one step before any dashboard: read the lines, classify the events, count what you found. log-analyzer implements that exact pipeline at its simplest.
It keys off the standard severity levels, so any log that uses DEBUG through FATAL works without a rules file. Line counts per level, a bounded list of error lines, and first/last timestamps answer the first question about any log: what happened and how often.
Text when you read, JSON when you feed
A --format text report prints straight to the terminal for a quick look; --format json writes a machine-readable record (level_counts, error_lines, first/last timestamp) that can be consumed by whatever tooling comes next.
The --max-errors limit keeps the error list useful instead of unbounded, and the whole thing fits in one dependency-free file.
What makes it technically interesting
- Classifies lines by standard level keywords (DEBUG, INFO, WARNING, ERROR, CRITICAL, FATAL) with no per-file format config
- Counts events per level and surfaces a bounded set of error lines (--max-errors, default 20) so errors bubble up without flooding the report
- Reports total and empty lines plus first/last timestamps, and emits the whole thing as text or JSON (--format json)
- Zero third-party packages — one stdlib Python file that reads any log and prints a readable summary