Skip to main content

Module parser

Module parser 

Source
Expand description

Log parsing and styling utilities.

This module provides functionality to parse JSON and plain text log entries, detect log levels, extract timestamps, and style them for terminal display with syntax highlighting and theme support.

Structs§

LogEntry
A parsed log entry with its original text, pretty-printed version, severity level, optional parsed timestamp, and optional source identifier.

Enums§

Highlight
The type of search highlighting to apply.
LogLevel
Log severity level.

Functions§

format_relative_time
Formats a timestamp as a human-readable relative time string (e.g., “3s ago”, “2m ago”).
parse_log
Parses a raw log line into a structured LogEntry.
style_log
Styles a log entry with level-based coloring and optional search highlighting.