Documentation ¶
Index ¶
- Constants
- func Debug(c context.Context, msg string, fields ...zap.Field)
- func Debugf(c context.Context, format string, args ...interface{})
- func Error(c context.Context, msg string, fields ...zap.Field)
- func Errorf(c context.Context, format string, args ...interface{})
- func Fatal(c context.Context, msg string, fields ...zap.Field)
- func Fatalf(c context.Context, format string, args ...interface{})
- func Info(c context.Context, msg string, fields ...zap.Field)
- func Infof(c context.Context, format string, args ...interface{})
- func Init(profile string, config *Config)
- func NewZapLogger(profile string, config *Config) *zap.Logger
- func Panic(c context.Context, msg string, fields ...zap.Field)
- func Panicf(c context.Context, format string, args ...interface{})
- func Sync()
- func Warn(c context.Context, msg string, fields ...zap.Field)
- func Warnf(c context.Context, format string, args ...interface{})
- func WithTrace(c context.Context, traceID string) context.Context
- type Config
- type GormLogger
- func (g GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (g GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (g GormLogger) LogMode(gormLogLevel gormlogger.LogLevel) gormlogger.Interface
- func (g GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (g GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
View Source
const GormLoggerCallerSkip = 2
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Level string `mapstructure:"level"` Dir string `mapstructure:"dir"` MaxSize int `mapstructure:"maxSize"` MaxBackups int `mapstructure:"maxBackups"` MaxAge int `mapstructure:"maxAge"` SkipPaths []string `mapstructure:"skipPaths"` Desensitize bool `mapstructure:"desensitize"` SkipFields []string `mapstructure:"skipFields"` }
type GormLogger ¶
func NewGormLogger ¶
func NewGormLogger() GormLogger
func (GormLogger) Error ¶
func (g GormLogger) Error(ctx context.Context, msg string, data ...interface{})
Error 实现 gorm logger 接口方法
func (GormLogger) Info ¶
func (g GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Info 实现 gorm logger 接口方法
func (GormLogger) LogMode ¶
func (g GormLogger) LogMode(gormLogLevel gormlogger.LogLevel) gormlogger.Interface
LogMode 实现 gorm logger 接口方法
Click to show internal directories.
Click to hide internal directories.