Documentation ¶
Index ¶
- type Gorm
- func (l *Gorm) Error(ctx context.Context, msg string, data ...interface{})
- func (l *Gorm) Info(ctx context.Context, msg string, data ...interface{})
- func (l *Gorm) LogMode(level logger.LogLevel) logger.Interface
- func (l *Gorm) Trace(ctx context.Context, begin time.Time, ...)
- func (l *Gorm) Warn(ctx context.Context, msg string, data ...interface{})
- type GormConfig
- type GormSetting
- type GormZap
- func (l *GormZap) Error(ctx context.Context, msg string, data ...interface{})
- func (l *GormZap) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormZap) LogMode(level logger.LogLevel) logger.Interface
- func (l *GormZap) Trace(ctx context.Context, begin time.Time, ...)
- func (l *GormZap) Warn(ctx context.Context, msg string, data ...interface{})
- type GormZapConfig
- type GormZapSetting
- type Interface
- type LogLevel
- type LogLevelZap
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) GetEntry() *logrus.Entry
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Panicln(args ...interface{})
- func (l *Logger) Print(args ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- func (l *Logger) Println(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- func (l *Logger) Warningln(args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
- func (l *Logger) WithContext(ctx context.Context) *Logger
- func (l *Logger) WithContextValue(key string) *Logger
- func (l *Logger) WithError(err error) *Logger
- func (l *Logger) WithField(key string, value interface{}) *Logger
- func (l *Logger) WithFields(fields logrus.Fields) *Logger
- type ZapInterface
- type ZapLogger
- func (l *ZapLogger) DPanic(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) DPanicf(format string, args ...interface{})
- func (l *ZapLogger) DPanicln(args ...interface{})
- func (l *ZapLogger) Debug(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Debugf(format string, args ...interface{})
- func (l *ZapLogger) Debugln(args ...interface{})
- func (l *ZapLogger) Error(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Errorf(format string, args ...interface{})
- func (l *ZapLogger) Errorln(args ...interface{})
- func (l *ZapLogger) Fatal(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Fatalf(format string, args ...interface{})
- func (l *ZapLogger) Fatalln(args ...interface{})
- func (l *ZapLogger) Info(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Infof(format string, args ...interface{})
- func (l *ZapLogger) Infoln(args ...interface{})
- func (l *ZapLogger) Panic(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Panicf(format string, args ...interface{})
- func (l *ZapLogger) Panicln(args ...interface{})
- func (l *ZapLogger) Warn(msg string, fields ...zapcore.Field)
- func (l *ZapLogger) Warnf(format string, args ...interface{})
- func (l *ZapLogger) Warnln(args ...interface{})
- func (l *ZapLogger) With(fields ...zapcore.Field) *ZapLogger
- func (l *ZapLogger) WithError(err error) *ZapLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gorm ¶ added in v0.0.21
type Gorm struct {
// contains filtered or unexported fields
}
Gorm struct.
type GormConfig ¶
type GormConfig struct { // If the time specified by SlowThreshold is exceeded, it is displayed in the log as a SlowQuery. SlowThreshold time.Duration // If true is specified for IgnoreRecordNotFoundError, no log is output at the error level even if the record does not exist as a search result. // If false, logs are output at the error level when a record does not exist as a search result. IgnoreRecordNotFoundError bool // LogLevel outputs logs above the specified level. LogLevel LogLevel }
GormConfig set configurations.
type GormSetting ¶ added in v0.0.21
type GormSetting struct { Logger *logrus.Logger GormConfig *GormConfig }
GormSetting sets configurations.
type GormZap ¶ added in v0.0.28
type GormZap struct {
// contains filtered or unexported fields
}
GormZap struct.
func NewZapLoggerGorm ¶ added in v0.0.28
func NewZapLoggerGorm(c *GormZapSetting) *GormZap
NewZapLoggerGorm func
type GormZapConfig ¶ added in v0.0.28
type GormZapConfig struct { // If the time specified by SlowThreshold is exceeded, it is displayed in the log as a SlowQuery. SlowThreshold time.Duration // If true is specified for IgnoreRecordNotFoundError, no log is output at the error level even if the record does not exist as a search result. // If false, logs are output at the error level when a record does not exist as a search result. IgnoreRecordNotFoundError bool // LogLevel outputs logs above the specified level. LogLevel LogLevel }
GormZapConfig set configurations.
type GormZapSetting ¶ added in v0.0.28
type GormZapSetting struct { Config *zap.Config GormConfig *GormConfig }
GormSetting sets configurations.
type Interface ¶
type Interface interface { LogMode(logger.LogLevel) Interface Info(context.Context, string, ...interface{}) Warn(context.Context, string, ...interface{}) Error(context.Context, string, ...interface{}) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) }
Interface Gorm Logger interface.
type Logger ¶
Logger struct.
func (*Logger) Debugln ¶
func (l *Logger) Debugln(args ...interface{})
Debugln outputs debug level log.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(args ...interface{})
Errorln outputs error level log.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(args ...interface{})
Fatalln outputs fatal level log.
func (*Logger) Warning ¶
func (l *Logger) Warning(args ...interface{})
Warning outputs warn level log.
func (*Logger) Warningln ¶
func (l *Logger) Warningln(args ...interface{})
Warningln outputs warn level log.
func (*Logger) WithContext ¶
WithContext calls WithContext function of logger entry.
func (*Logger) WithContextValue ¶
WithContextValue calls WithField function of logger entry.
type ZapInterface ¶ added in v0.0.28
type ZapInterface interface { LogMode(zapcore.Level) Interface Info(context.Context, string, ...interface{}) Warn(context.Context, string, ...interface{}) Error(context.Context, string, ...interface{}) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) }
ZapInterface Gorm Logger interface.
type ZapLogger ¶ added in v0.0.28
ZapLogger struct.
func NewZapLogger ¶ added in v0.0.28
NewZapLogger returns an instance of logger
func (*ZapLogger) DPanicln ¶ added in v0.0.28
func (l *ZapLogger) DPanicln(args ...interface{})
DPanicln outputs panic log.
func (*ZapLogger) Debugln ¶ added in v0.0.28
func (l *ZapLogger) Debugln(args ...interface{})
Debugln outputs debug level log.
func (*ZapLogger) Errorln ¶ added in v0.0.28
func (l *ZapLogger) Errorln(args ...interface{})
Errorln outputs error level log.
func (*ZapLogger) Fatalln ¶ added in v0.0.28
func (l *ZapLogger) Fatalln(args ...interface{})
Fatalln outputs fatal level log.
func (*ZapLogger) Infoln ¶ added in v0.0.28
func (l *ZapLogger) Infoln(args ...interface{})
Infoln outputs info level log.
func (*ZapLogger) Panicln ¶ added in v0.0.28
func (l *ZapLogger) Panicln(args ...interface{})
Panicln outputs panic log.
func (*ZapLogger) Warnln ¶ added in v0.0.28
func (l *ZapLogger) Warnln(args ...interface{})
Warnln outputs warn level log.