logviewer/logparse
2026-04-04 21:46:55 +02:00
..
proptest-regressions better parsing 2026-04-03 16:47:32 +02:00
src pretty printing 2026-04-04 21:46:55 +02:00
Cargo.toml pretty printing 2026-04-04 21:46:55 +02:00
README.md docs and line/offset numbers in paths 2026-04-02 10:16:24 +02:00

Logparse

This crate makes a best-effort parsing for arbitrary text that may contain rust-like debug output. This is intended for logs, that contain rust's debug output, and that you might want to highlight opposing parentheses, brackets, etc in.

Log messages, when parsed, can always be pretty printed back into their textual form perfectly. The syntax tree unambiguously records any spaces in the source text. There are tests that ensure this property for a very large number of inputs.

In addition, any log message can be parsed. parse_input returns a result, but as far as I'm aware, the parser is flexible enough to never reject, and always falls back to categorizing text as just text. There are also property tests to ensure this.