logger

package
v0.0.0-...-1bd3253 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BodyDumpHandler

func BodyDumpHandler(c echo.Context, _, resBody []byte)

func LoggerHook

func LoggerHook() echo.MiddlewareFunc

LoggerHook is a function to process middleware.

func ZapMiddleware

func ZapMiddleware(c echo.Context, next echo.HandlerFunc) error

Types

type ContextFn

type ContextFn func(ctx context.Context) []zapcore.Field

type Logger

type Logger struct {
	ZapLogger                 *zap.Logger
	LogLevel                  glogger.LogLevel
	SlowThreshold             time.Duration
	SkipCallerLookup          bool
	IgnoreRecordNotFoundError bool
	Context                   ContextFn
}

func New

func New(zapLogger *zap.Logger) Logger

func (Logger) Error

func (l Logger) Error(ctx context.Context, str string, args ...interface{})

func (Logger) Info

func (l Logger) Info(ctx context.Context, str string, args ...interface{})

func (Logger) LogMode

func (l Logger) LogMode(level glogger.LogLevel) glogger.Interface

func (Logger) SetAsDefault

func (l Logger) SetAsDefault()

func (Logger) Trace

func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (Logger) Warn

func (l Logger) Warn(ctx context.Context, str string, args ...interface{})

Jump to

Keyboard shortcuts

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