coreZapLog

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *zap.Logger

	//LoggerSkip 需要跳过封装的文件
	LoggerSkip     *zap.Logger
	LoggerSkipGorm *zap.Logger
)

Functions

func DebugCtx

func DebugCtx(c context.Context, msg string, fields ...zap.Field)

func ErrorCtx

func ErrorCtx(c context.Context, msg string, fields ...zap.Field)

func InfoCtx

func InfoCtx(c context.Context, msg string, fields ...zap.Field)

func InitLogger

func InitLogger(cmd string)

func WarnCtx

func WarnCtx(c context.Context, msg string, fields ...zap.Field)

func WithContext

func WithContext(c context.Context) *zap.Logger

Types

type ZapGormLogger

type ZapGormLogger struct {
	ZapLogger     *zap.Logger
	LogLevel      logger.LogLevel
	SlowThreshold time.Duration
}

func NewGormLogger

func NewGormLogger(zapLogger *zap.Logger, level logger.LogLevel, slowThreshold time.Duration) *ZapGormLogger

func (*ZapGormLogger) Error

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

func (*ZapGormLogger) Info

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

func (*ZapGormLogger) LogMode

func (l *ZapGormLogger) LogMode(level logger.LogLevel) logger.Interface

func (*ZapGormLogger) Trace

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

func (*ZapGormLogger) Warn

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

Jump to

Keyboard shortcuts

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