Skip to main content

log_template_collapse

Function log_template_collapse 

Source
pub fn log_template_collapse(
    text: &str,
    min_run_length: usize,
) -> Result<LogTemplateResult>
Expand description

Collapse consecutive lines that are identical except for VOLATILE spans: timestamps, durations, percentages. What exact RLE (identical lines only) leaves on the table in real logs is mostly timestamp spam.

Deliberately narrow — the predecessor of this stage (pattern-run detection) was removed for eating ls filenames. Rules:

  • Only timestamps, durations, and percentages count as volatile. Hex ids, UUIDs, filenames, and plain integers make lines DIFFERENT.
  • Only consecutive lines collapse, and the first line stays verbatim.
  • The marker names what varied, so the loss is explicit.