source

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LazyLogEntries added in v0.4.0

type LazyLogEntries []LazyLogEntry

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

func LoadLogsFromFile

func LoadLogsFromFile(
	path string,
	cfg *config.Config,
) (_ LazyLogEntries, err error)

LoadLogsFromFile loads json log entries from file.

func ParseLogEntriesFromReader added in v0.4.0

func ParseLogEntriesFromReader(
	reader io.Reader,
	cfg *config.Config,
) (LazyLogEntries, error)

func (LazyLogEntries) Filter added in v0.4.0

func (entries LazyLogEntries) Filter(term string) LazyLogEntries

Filter filters entries by ignore case exact match.

func (LazyLogEntries) Reverse added in v0.4.0

func (entries LazyLogEntries) Reverse() LazyLogEntries

Reverse all entries.

type LazyLogEntry added in v0.4.0

type LazyLogEntry struct {
	Line json.RawMessage
}

LazyLogEntry holds unredenred LogEntry. Use `LogEntry` getter.

func (LazyLogEntry) LogEntry added in v0.4.0

func (e LazyLogEntry) LogEntry(cfg *config.Config) LogEntry

LogEntry parses and returns `LogEntry`.

func (LazyLogEntry) Row added in v0.4.0

func (e LazyLogEntry) Row(cfg *config.Config) table.Row

Row returns table.Row representation of the log entry.

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, customMapping map[string]string) Level

ParseLevel parses level from the text value.

nolint: cyclop // Switch-case.

func (Level) String

func (l Level) String() string

String implement fmt.Stringer interface.

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