logs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIColorEnabled added in v0.2.2

func CLIColorEnabled() bool

func CLIFormat added in v0.2.1

func CLIFormat() string

func EmitCLIEventf added in v0.2.2

func EmitCLIEventf(fn func(level int, format string, args ...any) error, level int, event CLIEvent) error

func FormatCLIJSON added in v0.2.1

func FormatCLIJSON(event CLIEvent) ([]byte, error)

func FormatCLIText added in v0.2.1

func FormatCLIText(event CLIEvent) string

func FormatLogText

func FormatLogText(record LogRecord) string

func MatchesLogFilters

func MatchesLogFilters(record LogRecord, filters LogFilters) bool

func RenderCLI added in v0.2.1

func RenderCLI(event CLIEvent, format string) (string, error)

func RenderCLIOrFallback added in v0.2.2

func RenderCLIOrFallback(event CLIEvent) string

func RenderDefaultCLI added in v0.2.1

func RenderDefaultCLI(event CLIEvent) (string, error)

func SetCLIColorEnabled added in v0.2.2

func SetCLIColorEnabled(enabled bool)

func SetCLIFormat added in v0.2.1

func SetCLIFormat(format string)

func WrapCLISubprocessWriter added in v0.2.2

func WrapCLISubprocessWriter(command string, writer io.Writer) io.Writer

func WrapCLISubprocessWriters added in v0.2.2

func WrapCLISubprocessWriters(command string, stdout io.Writer, stderr io.Writer) (io.Writer, io.Writer)

func WriteCLIEvent added in v0.2.2

func WriteCLIEvent(w io.Writer, event CLIEvent) error

func WriterSupportsANSI added in v0.2.2

func WriterSupportsANSI(w io.Writer) bool

Types

type CLIEvent added in v0.2.1

type CLIEvent struct {
	TS        time.Time
	Level     string
	Component string
	Event     string
	Message   string
	Attrs     map[string]any
}

type LogFilters

type LogFilters struct {
	EventType string
	JobID     string
	Status    string
	Level     string
}

type LogRecord

type LogRecord struct {
	TS        string         `json:"ts"`
	Source    string         `json:"source,omitempty"`
	EventType string         `json:"event_type"`
	Level     string         `json:"level"`
	Message   string         `json:"message"`
	JobID     string         `json:"job_id,omitempty"`
	Status    string         `json:"status,omitempty"`
	Extra     map[string]any `json:"extra,omitempty"`
}

func NormalizeAuditRecord

func NormalizeAuditRecord(raw map[string]any) LogRecord

func NormalizeJSONLine

func NormalizeJSONLine(line []byte) (LogRecord, error)

func NormalizeJournalRecord

func NormalizeJournalRecord(raw map[string]any) LogRecord

func (LogRecord) ExtraValue

func (r LogRecord) ExtraValue(key string) any

Jump to

Keyboard shortcuts

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