Documentation
¶
Index ¶
- func New(zapLogger *zap.Logger) gormlogger.Interface
- type Logger
- func (l Logger) Error(_ context.Context, str string, args ...interface{})
- func (l Logger) Info(_ context.Context, str string, args ...interface{})
- func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
- func (l Logger) SetAsDefault()
- func (l Logger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l Logger) Warn(_ context.Context, str string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct { ZapLogger *zap.Logger LogLevel gormlogger.LogLevel SlowThreshold time.Duration SkipCallerLookup bool IgnoreRecordNotFoundError bool }
This type implement the gorm.io/gorm/logger.Interface interface. It is to be used as a replacement for the original logger
func (Logger) LogMode ¶
func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
Set the log mode to the value passed as argument
func (Logger) SetAsDefault ¶
func (l Logger) SetAsDefault()
Set the global instance of gorm to the local instance of gormzap logger
Click to show internal directories.
Click to hide internal directories.