Documentation ¶
Index ¶
- Constants
- Variables
- func Ctx(ctx context.Context) *zap.Logger
- func DefaultGormLogger() logger.Interface
- func With(parent context.Context, l *zap.Logger) context.Context
- func WithFields(parent context.Context, fs ...zap.Field) context.Context
- type Config
- type GormLogger
- func (l GormLogger) Error(ctx context.Context, str string, args ...interface{})
- func (l GormLogger) Info(ctx context.Context, str string, args ...interface{})
- func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l GormLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
- func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(ctx context.Context, str string, args ...interface{})
Constants ¶
Variables ¶
View Source
var Dict = zap.Dict
Deprecated: use zap.Dict instead. (go.uber.org/zap v1.26.0)
Functions ¶
func Ctx ¶ added in v0.2.0
Ctx returns a logger from ctx. If no logger is found in ctx, it returns the global logger.
func DefaultGormLogger ¶ added in v0.2.0
Types ¶
type GormLogger ¶ added in v0.2.0
type GormLogger struct {
Config
}
GormLogger is gorm.logger.Interface implementation using zapx.Ctx. It is not support Colorful.
func (GormLogger) Error ¶ added in v0.2.0
func (l GormLogger) Error(ctx context.Context, str string, args ...interface{})
func (GormLogger) Info ¶ added in v0.2.0
func (l GormLogger) Info(ctx context.Context, str string, args ...interface{})
func (*GormLogger) LogMode ¶ added in v0.2.0
func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
func (GormLogger) ParamsFilter ¶ added in v0.2.0
func (l GormLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
Click to show internal directories.
Click to hide internal directories.