Repository navigation
Add --top N to --summary - #4
Merged
Merged
Conversation
--top N sets how many of the most frequent ERROR and CRITICAL messages the summary lists (1 to 100, default 5).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
--summaryalways listed the five most frequent error messages, so on a log with many distinct failures the rest were hidden, and on a short log five lines were more than needed.After
--top N(or--top=N) sets the number of listed error messages, from 1 to 100. Without it nothing changes.It works with both
--summary-format textandjson. An invalid value exits with status 2 and an argparse message;--topwithout--summaryexits with status 2 andlogslice: --top requires --summary.How
src/logslice/filters.py:parse_topaccepts one to three ASCII digits from 1 through 100.src/logslice/summary.py:renderandrender_jsontaketop(default 5).src/logslice/cli.py: the--topoption and the check that it needs--summary.README.md: options row and a Top N example.tests/test_top.py, plus small additions totests/test_cli.pyandtests/test_summary.py.