Documentation ¶
Index ¶
- type GormLogger
- func (gl *GormLogger) Error(ctx context.Context, msg string, data ...any)
- func (gl *GormLogger) Info(ctx context.Context, msg string, data ...any)
- func (gl *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (gl *GormLogger) ParamsFilter(ctx context.Context, sql string, params ...any) (string, []any)
- func (gl *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (gl *GormLogger) Warn(ctx context.Context, msg string, data ...any)
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 ¶
Trace print sql message
Click to show internal directories.
Click to hide internal directories.