source

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLogsFromFile

func LoadLogsFromFile(path string) func() tea.Msg

LoadLogsFromFile loads json log entries from file.

Types

type Level

type Level string

Level of the logs entity.

const (
	LevelUnknown Level = "none"
)

Possible log levels.

func (Level) String

func (l Level) String() string

String implement fmt.Stringer interface.

type LogEntries

type LogEntries []LogEntry

LogEntries is a helper type definition for the slice of log entries.

func (LogEntries) Filter

func (entries LogEntries) Filter(term string) LogEntries

Filter filters entries by ignore case exact match.

func (LogEntries) Reverse

func (entries LogEntries) Reverse() LogEntries

func (LogEntries) Rows

func (entries LogEntries) Rows() []table.Row

Rows returns all table.Row by log entries.

type LogEntry

type LogEntry struct {
	Time    string
	Level   Level
	Message string
	Line    json.RawMessage
}

LogEntry is a single partly-parse record of the log.

func ParseLogEntry

func ParseLogEntry(line json.RawMessage) LogEntry

ParseLogEntry parses a single log entry from the json line.

func (LogEntry) Row

func (e LogEntry) Row() table.Row

Row returns table.Row representation of the log entry.

Jump to

Keyboard shortcuts

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