Skip to main content

Crate logparse

Crate logparse 

Source
Expand description

§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.

Modules§

ast
The structure of parsed log lines

Structs§

Config
Configuration options for into_spans
Span
A Span is a piece of categorized text, based on the parsing done by parse_input.

Enums§

SpanKind
Text categories, based on the parsing.

Functions§

into_spans
Turn an ast node into Spans.
parse_input
Parses an input string (a log line) into an ast.