handler

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

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

func NewBaseHandler

func NewBaseHandler(conf *config.HandlerConfig) *BaseHandler

func (*BaseHandler) Contains

func (bh *BaseHandler) Contains(level core.Level) bool

func (*BaseHandler) DefaultSetting

func (bh *BaseHandler) DefaultSetting()

func (*BaseHandler) Handle

func (bh *BaseHandler) Handle(entry *core.LogEntry) error

func (*BaseHandler) Init

func (bh *BaseHandler) Init() error

func (*BaseHandler) MarkerMatched

func (bh *BaseHandler) MarkerMatched(marker string) bool

func (*BaseHandler) Shutdown

func (bh *BaseHandler) Shutdown()

type FileHandler

type FileHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewFileHandler

func NewFileHandler(conf *config.HandlerConfig) *FileHandler

func (*FileHandler) Flush

func (fh *FileHandler) Flush(bs []byte) error

func (*FileHandler) Handle

func (fh *FileHandler) Handle(entry *core.LogEntry) (err error)

func (*FileHandler) Init

func (fh *FileHandler) Init() error

func (*FileHandler) Rotate

func (fh *FileHandler) Rotate() error

type Flusher

type Flusher interface {
	Flush(bs []byte) error
}

type Handler

type Handler interface {
	Init() error
	Handle(entry *core.LogEntry) error
	Shutdown()
}

func HandlerFactory

func HandlerFactory(conf *config.HandlerConfig) Handler

type HandlerType

type HandlerType int
const (
	STD HandlerType = iota
	FILE
)

func NewHandlerType

func NewHandlerType(handlerType string) HandlerType

func (HandlerType) String

func (h HandlerType) String() string

type LogEntries

type LogEntries = []*core.LogEntry

type StdHandler

type StdHandler struct {
	*BaseHandler
}

func NewStdHandler

func NewStdHandler(handlerConf *config.HandlerConfig) *StdHandler

func (*StdHandler) Handle

func (sh *StdHandler) Handle(entry *core.LogEntry) error

func (*StdHandler) Init

func (sh *StdHandler) Init() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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