Skip to content

Add --summary-format {text,json} - #2

Merged
Gulliby merged 1 commit into
mainfrom
feature/summary-format-json
Oct 12, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/summary-format-json

Conversation

@Gulliby

@Gulliby Gulliby commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Before
--summary printed only human-readable text, which is awkward to parse in scripts and CI.

After
--summary-format json prints the summary as JSON (default text is unchanged):

logslice app.log --summary --summary-format json

It outputs levels, top_errors and skipped_lines; the README shows the exact output. Using --summary-format json without --summary exits with code 2 and logslice: --summary-format requires --summary.

How

  • src/logslice/summary.py: new Summary.render_json().
  • src/logslice/cli.py: new --summary-format {text,json} option with the check above.
  • Tests added in tests/test_summary.py and tests/test_cli.py; README options table and usage updated.

@Gulliby
Gulliby merged commit 610819c into main Oct 12, 2026
6 checks passed
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.

1 participant