interceptor

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

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

func NewInterceptor

func NewInterceptor(log log.Logger) *Interceptor

func (*Interceptor) AddCallerSkip

func (l *Interceptor) AddCallerSkip(skip int) log.Logger

func (*Interceptor) AddWatcher

func (l *Interceptor) AddWatcher(msgPattern string, opts ...LogReceiverOption) chan Message

func (*Interceptor) ChangeWriters

func (l *Interceptor) ChangeWriters(writers ...io.Writer)

func (*Interceptor) Close

func (l *Interceptor) Close()

func (*Interceptor) Debug

func (l *Interceptor) Debug(msg string, fields ...log.Field)

func (*Interceptor) Error

func (l *Interceptor) Error(err error, fields ...log.Field)

func (*Interceptor) Info

func (l *Interceptor) Info(msg string, fields ...log.Field)

func (*Interceptor) Level

func (l *Interceptor) Level() log.Level

func (*Interceptor) Named

func (l *Interceptor) Named(name string) log.Logger

func (*Interceptor) SetLevel

func (l *Interceptor) SetLevel(lvl log.Level)

func (*Interceptor) Warning

func (l *Interceptor) Warning(msg string, fields ...log.Field)

func (*Interceptor) WithFields

func (l *Interceptor) WithFields(fields ...log.Field) log.Logger

func (*Interceptor) WithLevel

func (l *Interceptor) WithLevel(lvl log.Level) log.Logger

type LogReceiverOption

type LogReceiverOption func(*logReceiver)

func WithErrorHandler

func WithErrorHandler(handler func(Message) bool) LogReceiverOption

func WithExpectedCount

func WithExpectedCount(expCount int) LogReceiverOption

func WithSkipError

func WithSkipError(errs ...error) LogReceiverOption

func WithSkipErrorByMessage

func WithSkipErrorByMessage(s ...string) LogReceiverOption

type Message

type Message struct {
	Msg string
	Err error
}

Jump to

Keyboard shortcuts

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