gormlog

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormLogger

type GormLogger struct {
	Logger                   log.Logger
	Level                    log.Level
	ErrorSQLLevel            log.Level
	SlowSQLLevel             log.Level
	SlowThreshold            time.Duration
	TraceRecordNotFoundError bool
	ParameterizedQueries     bool
}

func NewGormLogger

func NewGormLogger(logger log.Logger, slowSQL ...time.Duration) *GormLogger

func (*GormLogger) Error

func (gl *GormLogger) Error(ctx context.Context, msg string, data ...any)

Error print error messages

func (*GormLogger) Info

func (gl *GormLogger) Info(ctx context.Context, msg string, data ...any)

Info print info

func (*GormLogger) LogMode

func (gl *GormLogger) LogMode(level logger.LogLevel) logger.Interface

LogMode log mode

func (*GormLogger) ParamsFilter

func (gl *GormLogger) ParamsFilter(ctx context.Context, sql string, params ...any) (string, []any)

Trace print sql message

func (*GormLogger) Trace

func (gl *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

Trace print sql message

func (*GormLogger) Warn

func (gl *GormLogger) Warn(ctx context.Context, msg string, data ...any)

Warn print warn messages

Jump to

Keyboard shortcuts

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