Repository navigation
logdelta 0.3.0
cargo install logdeltaChecked against real CI logs for the first time: a failing pytest job of the pytest project on GitHub Actions (854 lines) and three passing runs of the same job (about 1,270 lines each), then a vitest job and a tokio job the same way. The numbers below are 0.2.3 from crates.io and this release on the same files.
Added
- Blocks. Findings whose lines sit together are reported as one. The pytest failure was 311 findings, 543 lines of report: every line of the traceback its own NEW finding, every line of the upload steps the job never reached its own GONE finding. It is now 4: the traceback (51 templates), the short test summary (27), the lines the job exited on (5), and one GONE block of 198 templates. vitest: 26 findings to 6. tokio: 99 to 13.
- A NEW block is a run of new lines, with up to two known lines let through, found while the target is read. It prints one line per template with its line number, and
×Nwhere a template has more lines. The same stack trace logged 25 times is one block that says so. - A GONE block is located in the first baseline, the run that still had the lines.
- A template folds into a block only if all of its lines are in such groups, so a message that also occurs on its own keeps its own finding and its count. Grouping never makes a report longer.
--block-lines N(default 12) sets how much of a long block is printed: its start and its end.--flatturns grouping off.--jsongains ablocksarray and ablockindex on each finding that is part of one;findingsstill lists every template. Memory stays flat: a few numbers per template, nothing per line.
- A NEW block is a run of new lines, with up to two known lines let through, found while the target is read. It prints one line per template with its line number, and
- A GONE finding shows the line the first baseline had, with its line number (
first_baseline_line_noandfirst_baseline_rawin--json), where it used to show the template alone. - Test-runner progress lines are masked:
....s....x.... [ 42%]becomes<PROGRESS> [ <NUM>%], or<PROGRESS!>when it holds anForE. Which tests land on which line depends on scheduling, so two passing runs of the pytest job diffed to 27 findings, all of them dots. Now 0. - OSC escape sequences (hyperlinks, window titles) are stripped before mining, as CSI color codes already were.
- Library:
blocks::Block,DiffResult::blocks,DiffOptions::group,scoring::count_g_test,Drain::add_token_slice,mask::strip_escapes,output::printable.
Changed
- CHANGED needs the count to move, not only the share. The score compares a template's share of the log, and a share moves whenever the run is shorter or longer for other reasons: the failing pytest job printed its 257
[new branch]lines 258 times in a log a third shorter, and that was a CHANGED finding ("more often", score 38). A second G-test on the counts alone (the baselines' total against the target's, as two Poisson counts) now has to clear the same cutoff, in the same direction. A bigger run with the same mix still changes nothing, which is what the share test is for. - A NEW VALUE on a line inside a NEW block is part of the block and is not listed again.
- Reports print log lines without the log's own escape sequences and control characters. A colored CI log put its color codes into the terminal report (76 lines of the pytest report carried them, also under
--color never), where a line cut to the terminal width left the color on for everything after it, and into Markdown tables as stray[31m.--jsonkeeps every line as it was read. - The header counts what the report shows and says what
--flatwould:4 findings (284 with --flat). - The web demo shows the engine's blocks (it grouped new lines on its own before, by first line only), has a GONE block card, cuts a long block to its start and end with a button for the rest, and strips color codes from the lines it shows.
Fixed
- A line that is mostly placeholders never matched its own template. The similarity between a line and a template skipped positions where both hold the same masking placeholder, but still divided by the full length, so
<NUM> <NUM> <HEX> okscored 1/4 against itself and every such line started a new template. 100,000 lines of that shape were 100,000 templates, 77.55 s and 45.7 MB intemplates(each line compared against every template before it); they are one template in 0.18 s and 7.2 MB. In a diff, a line identical in every run was reported NEW: the toolchain line- 1.98.1 aarch64-apple-darwin 48a229ce…in tokio's logs, between two passing runs. Such positions are now left out of both sides of the fraction.