glogger

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormLog

type GormLog struct {
	Position      string
	Duration      float64
	SQL           string
	Rows          int64
	SlowThreshold time.Duration
	// contains filtered or unexported fields
}

func (GormLog) String

func (gl GormLog) String()

type GormLoggerCallbacks

type GormLoggerCallbacks struct {
	// 慢sql阈值
	SlowThreshold time.Duration
	// contains filtered or unexported fields
}

GormLoggerCallbacks 利用callback实现的gorm plugin 用来替换gorm自带的logger

func NewGormLoggerCallBacks

func NewGormLoggerCallBacks(l logger.Logger, s time.Duration) *GormLoggerCallbacks

func (*GormLoggerCallbacks) Initialize

func (c *GormLoggerCallbacks) Initialize(db *gorm.DB) error

func (*GormLoggerCallbacks) Name

func (c *GormLoggerCallbacks) Name() string

Jump to

Keyboard shortcuts

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