logger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	PanicLevel uint = iota
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	TraceLevel
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncOpts

type FuncOpts func(*logger)

func WithDispatcher

func WithDispatcher(dispatcher map[string]io.Writer) FuncOpts

func WithFormatter

func WithFormatter(formatter logrus.Formatter) FuncOpts

func WithLevel

func WithLevel(level string) FuncOpts

func WithLevels

func WithLevels(levels []string) FuncOpts

func WithReportCaller

func WithReportCaller(caller bool) FuncOpts

func WithSrvName

func WithSrvName(name string) FuncOpts

func WithWriter

func WithWriter(writer io.Writer) FuncOpts

type Log

type Log struct {
	*logrus.Logger
}

func NewLog

func NewLog(opts ...FuncOpts) *Log

func (*Log) Log

func (l *Log) Log(ctx context.Context, level uint, fields map[string]interface{}, v ...interface{})

type Logger

type Logger interface {
	Log(ctx context.Context, level uint, fields map[string]interface{}, v ...interface{})
}

type RawJSONFormatter added in v1.1.0

type RawJSONFormatter struct {
	*logrus.JSONFormatter
}

func (*RawJSONFormatter) Format added in v1.1.0

func (f *RawJSONFormatter) Format(entry *logrus.Entry) ([]byte, error)

Directories

Path Synopsis
engine_logger

Jump to

Keyboard shortcuts

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