gorm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormConfig

type GormConfig struct {
	ServiceName               string
	SlowThreshold             int
	InfoFile                  string
	ErrorFile                 string
	Level                     int
	SkipCallerLookup          bool
	IgnoreRecordNotFoundError bool
}

GormConfig is used to parse configuration file logger should be controlled with Options

type GormLogger

type GormLogger struct {
	*zap.Logger

	LogLevel                  gormLogger.LogLevel
	SlowThreshold             time.Duration
	SkipCallerLookup          bool
	IgnoreRecordNotFoundError bool
	// contains filtered or unexported fields
}

func NewGorm

func NewGorm(config *GormConfig, opts ...GormOption) (gl *GormLogger, err error)

func (*GormLogger) Close

func (l *GormLogger) Close() error

func (*GormLogger) Error

func (l *GormLogger) Error(ctx context.Context, msg string, args ...interface{})

func (*GormLogger) Info

func (l *GormLogger) Info(ctx context.Context, msg string, args ...interface{})

func (*GormLogger) LogMode

func (*GormLogger) Trace

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

func (*GormLogger) Warn

func (l *GormLogger) Warn(ctx context.Context, msg string, args ...interface{})

type GormOption

type GormOption func(gl *GormLogger)

Jump to

Keyboard shortcuts

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