orm

package
v1.0.1003 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Silent gormLogger.LogLevel = iota + 1
)

Variables

View Source
var (
	Default = New(nil, Config{
		SlowThreshold:             200 * time.Millisecond,
		LogLevel:                  gormLogger.Info,
		IgnoreRecordNotFoundError: false,
	})
	Recorder = traceRecorder{Interface: Default, BeginAt: time.Now()}
)
View Source
var ErrRecordNotFound = errors.New("record not found")

Functions

func MaskValue

func MaskValue(sql string) string

func New

Types

type Config

type Config struct {
	SlowThreshold             time.Duration
	IgnoreRecordNotFoundError bool
	LogLevel                  gormLogger.LogLevel
}

type Logger

type Logger struct {
	Config
	// contains filtered or unexported fields
}

func (*Logger) Error

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

Error print error messages

func (*Logger) Info

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

Info print info

func (*Logger) LogMode

func (l *Logger) LogMode(level gormLogger.LogLevel) gormLogger.Interface

LogMode log mode

func (*Logger) Trace

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

Trace print sql message

func (*Logger) Warn

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

Warn print warn messages

Jump to

Keyboard shortcuts

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