databaselogger

package
v0.0.0-...-56195c4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqlLoggerMid

func NewSqlLoggerMid(logFunc func(sql string, rows int, seconds int)) gorm.Plugin

Types

type SqlLoggerMid

type SqlLoggerMid struct {
	// 日志记录,sql,影响行数,执行时间(毫秒)
	LogFunc func(sql string, rows int, milliSeconds int)
}

func NewSqlLoggerMidBuilder

func NewSqlLoggerMidBuilder(logFunc func(sql string, rows int, seconds int)) *SqlLoggerMid

func (*SqlLoggerMid) After

func (l *SqlLoggerMid) After() func(db *gorm.DB)

After 计算操作时间以及记录日志

func (*SqlLoggerMid) Before

func (l *SqlLoggerMid) Before() func(db *gorm.DB)

Before 记录开始操作的时间

func (*SqlLoggerMid) Initialize

func (l *SqlLoggerMid) Initialize(db *gorm.DB) error

func (*SqlLoggerMid) Name

func (l *SqlLoggerMid) Name() string

Jump to

Keyboard shortcuts

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