log

package
v0.0.0-...-ea14be2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Logger

type Logger struct {
	ZapLogger *zap.Logger
	sync.RWMutex
	Opts *conf.Config

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

func GetLogger

func GetLogger() *Logger

func NewLogger

func NewLogger(cf *conf.Config) *Logger

func (*Logger) AddCtx

func (l *Logger) AddCtx(ctx context.Context, field ...zap.Field) (context.Context, *zap.Logger)

func (*Logger) Error

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

func (*Logger) GetCtx

func (l *Logger) GetCtx(ctx context.Context) *zap.Logger

func (*Logger) GetLevel

func (l *Logger) GetLevel() (level zapcore.Level)

func (*Logger) Info

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

func (*Logger) LogMode

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

func (*Logger) Trace

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

func (*Logger) Warn

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

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *zap.Logger

Jump to

Keyboard shortcuts

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