logentry

package
v0.0.0-...-584518c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptAllPredicate

type AcceptAllPredicate struct{}

func (AcceptAllPredicate) Applies

func (this AcceptAllPredicate) Applies(*LogEntry) bool

type AcceptNothingPredicate

type AcceptNothingPredicate struct{}

func (AcceptNothingPredicate) Applies

func (this AcceptNothingPredicate) Applies(*LogEntry) bool

type AfterPredicate

type AfterPredicate struct {
	FieldName        string
	EarlierTimestamp time.Time
}

func (AfterPredicate) Applies

func (this AfterPredicate) Applies(logEntry *LogEntry) bool

type AllOfPredicate

type AllOfPredicate struct{ SubPredicates []Predicate }

func (AllOfPredicate) Applies

func (this AllOfPredicate) Applies(logEntry *LogEntry) bool

type AnyOfPredicate

type AnyOfPredicate struct{ SubPredicates []Predicate }

func (AnyOfPredicate) Applies

func (this AnyOfPredicate) Applies(logEntry *LogEntry) bool

type BeforePredicate

type BeforePredicate struct {
	FieldName      string
	LaterTimestamp time.Time
}

func (BeforePredicate) Applies

func (this BeforePredicate) Applies(logEntry *LogEntry) bool

type ContainsPredicate

type ContainsPredicate struct {
	FieldName     string
	ToBeContained string
}

func (ContainsPredicate) Applies

func (this ContainsPredicate) Applies(logEntry *LogEntry) bool

type IsEmptyPredicate

type IsEmptyPredicate struct{ FieldName string }

func (IsEmptyPredicate) Applies

func (this IsEmptyPredicate) Applies(logEntry *LogEntry) bool

type IsNotEmptyPredicate

type IsNotEmptyPredicate struct{ IsEmptyPredicate }

func (IsNotEmptyPredicate) Applies

func (this IsNotEmptyPredicate) Applies(logEntry *LogEntry) bool

type Level

type Level int
const (
	TRACE Level = iota
	DEBUG
	INFO
	WARNING
	ERROR
	FATAL
)

func LevelFromString

func LevelFromString(name string) (level Level, err error)

func (Level) String

func (l Level) String() string

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Level     Level
	Tags      []string
	Message   string
	Host      string
	User      string
	Thread    string
	Process   string
	Custom    map[string]string
}

func New

func New() (entry *LogEntry)

func (*LogEntry) AssignValue

func (l *LogEntry) AssignValue(fieldName string, value string) error

func (*LogEntry) FieldAsString

func (l *LogEntry) FieldAsString(fieldName string) (string, error)

func (*LogEntry) FieldAsTime

func (l *LogEntry) FieldAsTime(fieldName string) (time.Time, error)

func (*LogEntry) FieldValue

func (l *LogEntry) FieldValue(fieldName string) (fieldValue reflect.Value, actualFieldName string)

func (*LogEntry) IsTags

func (l *LogEntry) IsTags(fieldName string) bool

func (*LogEntry) IsTimestamp

func (l *LogEntry) IsTimestamp(fieldName string) bool

type MatchesPredicate

type MatchesPredicate struct {
	FieldName   string
	GrokPattern string
	// contains filtered or unexported fields
}

func (MatchesPredicate) Applies

func (this MatchesPredicate) Applies(logEntry *LogEntry) bool

type NoneOfPredicate

type NoneOfPredicate struct{ SubPredicates []Predicate }

func (NoneOfPredicate) Applies

func (this NoneOfPredicate) Applies(logEntry *LogEntry) bool

type NotPredicate

type NotPredicate struct{ SubPredicate Predicate }

func (NotPredicate) Applies

func (this NotPredicate) Applies(logEntry *LogEntry) bool

type Predicate

type Predicate interface {
	Applies(*LogEntry) bool
}

Jump to

Keyboard shortcuts

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