log

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Raw    string
	Fields map[string]any
	Valid  bool
}

Entry represents a parsed log line.

func Parse

func Parse(line string, format Format) Entry

Parse attempts to parse a line using the specified format. If format is FormatAuto, it tries to detect the format. If parsing fails, it returns an Entry with Valid=false and the raw line preserved.

type Format

type Format int

Format represents a log format type.

const (
	FormatGuess Format = iota
	FormatJSON
	FormatLogfmt
)

func ParseFormat

func ParseFormat(s string) Format

ParseFormat converts a string to a Format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL