adapter

package
v0.0.0-...-1561e87 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinLogger

func GinLogger() gin.HandlerFunc

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

Types

type ContextFn

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

type GORMAdapter

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

GORMAdapter Modified from "moul.io/zapgorm2"

func NewGORMAdapter

func NewGORMAdapter(zapLogger *zap.Logger) GORMAdapter

func (GORMAdapter) Error

func (a GORMAdapter) Error(ctx context.Context, str string, args ...interface{})

func (GORMAdapter) Info

func (a GORMAdapter) Info(ctx context.Context, str string, args ...interface{})

func (GORMAdapter) LogMode

func (GORMAdapter) SetAsDefault

func (a GORMAdapter) SetAsDefault()

func (GORMAdapter) Trace

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

func (GORMAdapter) Warn

func (a GORMAdapter) 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