parser

package
v0.0.0-...-ad93ae0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLogFormat = errors.New("non [] formated value found")

	ErrInvalidLogLevel = errors.New("in valid log level")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Err    error
	TS     time.Time
	Level  zapcore.Level
	Caller string
	Msg    string
	Data   []LogKV

	Processed bool // flag about this entry is processed by some processor
}

Entry contains log data from parsers.

func (Entry) SearchData

func (e Entry) SearchData(key string) (string, bool)

SearchData returns the corresponding Value in Data if key matches.

func (Entry) SearchDataBool

func (e Entry) SearchDataBool(key string) (bool, bool)

func (Entry) SearchDataInt64

func (e Entry) SearchDataInt64(key string) (int64, bool)

SearchDataInt64 returns corresponding parsed Value in Data as int64.

type LogKV

type LogKV struct {
	Key   string
	Value string
}

LogKV key value for log extra items.

type ZapTextParser

type ZapTextParser struct {
	// contains filtered or unexported fields
}

ZapTextParser parses zap text format log line data.

func (*ZapTextParser) Err

func (p *ZapTextParser) Err() error

func (*ZapTextParser) ParseLine

func (p *ZapTextParser) ParseLine(line []byte) Entry

ParseLine do the parsing procedure.

func (*ZapTextParser) String

func (p *ZapTextParser) String() string

Jump to

Keyboard shortcuts

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