logger

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel 1 = DEBUG, 2 = INFO, 3 = WARN, 4 = ERROR, 5 = OFF, 6 = PANIC, 7 = FATAL

const (
	LogLevelPanic LogLevel = iota
	LogLevelFatal
	LogLevelError
	LogLevelWarn
	LogLevelInfo
	LogLevelDebug
	LogLevelTrace
	LogLevelOff
)

func ParseLevel

func ParseLevel(value string) LogLevel

func (LogLevel) EchoLogLevel

func (l LogLevel) EchoLogLevel() int

func (LogLevel) Id

func (l LogLevel) Id() int

func (LogLevel) LogRushString

func (l LogLevel) LogRushString() string

type Manager

type Manager interface {
	Trace(messages ...interface{})
	TraceWithProps(props map[string]interface{}, messages ...interface{})

	Debug(messages ...interface{})
	DebugWhen(expr bool, f func(debug func(messages ...interface{})))
	DebugWithProps(props map[string]interface{}, messages ...interface{})

	Info(messages ...interface{})
	InfoWhen(expr bool, f func(info func(messages ...interface{})))
	InfoWithProps(props map[string]interface{}, messages ...interface{})
	InfoWithPropsWhen(expr bool, props map[string]interface{}, messages ...interface{})

	Warn(messages ...interface{})
	WarnWhen(expr bool, f func(warn func(messages ...interface{})))
	WarnWithProps(props map[string]interface{}, messages ...interface{})
	WarnWithPropsWhen(expr bool, props map[string]interface{}, messages ...interface{})

	WhenError(err error)
	WhenErrorWithProps(err error, props map[string]interface{})

	Error(messages ...interface{})
	ErrorWhen(expr bool, f func(e func(messages ...interface{})))
	ErrorWithProps(props map[string]interface{}, messages ...interface{})
	ErrorWithPropsWhen(expr bool, props map[string]interface{}, f func(messages func(args ...interface{})))

	Fatal(messages ...interface{})
	FatalWithProps(props map[string]interface{}, messages ...interface{})

	Panic(messages ...interface{})
	PanicWithProps(props map[string]interface{}, messages ...interface{})
}

func NewLogger

func NewLogger(level LogLevel, output io.Writer, opts ...Option) Manager

func NewMockLogger

func NewMockLogger() Manager

func NewNoop

func NewNoop() Manager

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithServiceName

func WithServiceName(v string) Option

func WithTZTimeFormatter

func WithTZTimeFormatter(v ts.TimeZone) Option

type TZFormatter

type TZFormatter struct {
	logrus.Formatter
	// contains filtered or unexported fields
}

func (TZFormatter) Format

func (t TZFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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