Documentation ¶
Index ¶
- type GormConfig
- type GormLogger
- func (l *GormLogger) Close() error
- func (l *GormLogger) Error(ctx context.Context, msg string, args ...interface{})
- func (l *GormLogger) Info(ctx context.Context, msg string, args ...interface{})
- func (l *GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
- func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *GormLogger) Warn(ctx context.Context, msg string, args ...interface{})
- type GormOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormConfig ¶
type GormConfig struct { ServiceName string SlowThreshold int InfoFile string ErrorFile string Level int SkipCallerLookup bool IgnoreRecordNotFoundError bool }
GormConfig is used to parse configuration file logger should be controlled with Options
type GormLogger ¶
type GormLogger struct { *zap.Logger LogLevel gormLogger.LogLevel SlowThreshold time.Duration SkipCallerLookup bool IgnoreRecordNotFoundError bool // contains filtered or unexported fields }
func NewGorm ¶
func NewGorm(config *GormConfig, opts ...GormOption) (gl *GormLogger, err error)
func (*GormLogger) Close ¶
func (l *GormLogger) Close() error
func (*GormLogger) Error ¶
func (l *GormLogger) Error(ctx context.Context, msg string, args ...interface{})
func (*GormLogger) Info ¶
func (l *GormLogger) Info(ctx context.Context, msg string, args ...interface{})
func (*GormLogger) LogMode ¶
func (l *GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
type GormOption ¶
type GormOption func(gl *GormLogger)
Click to show internal directories.
Click to hide internal directories.