source

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLogsFromFile

func LoadLogsFromFile(
	path string,
	cfg *config.Config,
) 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"
	LevelTrace   Level = "trace"
	LevelDebug   Level = "debug"
	LevelInfo    Level = "info"
	LevelWarning Level = "warn"
	LevelError   Level = "error"
	LevelPanic   Level = "panic"
	LevelFatal   Level = "fatal"
)

Possible log levels.

func ParseLevel added in v0.1.1

func ParseLevel(value string) Level

ParseLevel parses level from the text value.

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 {
	Fields []string
	Line   json.RawMessage
}

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

func ParseLogEntry

func ParseLogEntry(
	line json.RawMessage,
	cfg *config.Config,
) 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