coreZapLog

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 24 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 NewGinLogger added in v0.0.25

func NewGinLogger(conf GinLoggerConfig) gin.HandlerFunc

NewGinLogger 创建 gin 日志

func WarnCtx

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

func WithContext

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

Types

type GinLoggerConfig added in v0.0.25

type GinLoggerConfig struct {
	Config    gin.LoggerConfig
	WhiteList []string
}

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