Skip to content

Save filtered logs as original lines instead of TSV table - #36

Merged
laomou merged 1 commit into
mainfrom
feature/save-raw-lines
Jul 27, 2026
Merged

Save filtered logs as original lines instead of TSV table#36
laomou merged 1 commit into
mainfrom
feature/save-raw-lines

Conversation

@laomou

@laomou laomou commented Jul 27, 2026

Copy link
Copy Markdown
Owner

What

The Save filtered action used to re-join each entry's parsed fields (line number, date, time, level, pid, tid, tag, message) with tabs, producing an internal TSV table. This didn't match the source — most visibly for adb streams, whose saved output no longer looked like logcat.

Now it writes each entry's original line verbatim, so saved files preserve the source format (adb stream / original file) and can be re-parsed by LogFilter or other tools.

How

Every LogEntry already stores the whole original line as its backing buffer (fields are just byte ranges into it), so no extra memory is needed:

  • src/model.rs — add a raw() getter returning the complete original line.
  • src/app.rssave_filtered snapshots and writes raw() per row instead of re-joining fields with \t.

Scope unchanged

Still saves the current filtered rows (which equals all rows when no filter is set). Only the output format changed, not which rows are saved.

Testing

  • cargo build — clean, no new warnings.
  • cargo test — all 79 tests pass.

The "save filtered" action re-joined parsed fields (line number, date,
time, level, pid, tid, tag, message) with tabs, producing a table that
did not match the source — most visibly for adb streams, whose saved
output no longer looked like logcat.

Each LogEntry already stores the complete original line as its backing
buffer, so expose it via a new `raw()` getter and write that verbatim.
Saved files now preserve the source format (adb stream / original file)
and can be re-parsed by LogFilter or other tools. Save scope is
unchanged: still the current filtered rows (all rows when no filter set).
@laomou
laomou force-pushed the feature/save-raw-lines branch from 18000b0 to bfb4c4f Compare July 27, 2026 03:26
@laomou
laomou merged commit 51c1777 into main Jul 27, 2026
3 checks passed
@laomou
laomou deleted the feature/save-raw-lines branch July 27, 2026 03:29
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