Documentation ¶
Index ¶
- Constants
- func NewGORMLogger(config gorm.Config) gorm.Interface
- func WithFormatter(level logrus.Level)
- func WithTracking(ctx context.Context, trackingInfo TrackingInfo) context.Context
- 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(level gorm.LogLevel) gorm.Interface
- func (g *GORMLogger) Printf(ctx context.Context, msg string, data ...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{})
- 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) GetTrackingID() string
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Log(level logrus.Level, args ...interface{})
- func (l *Logger) Logf(level logrus.Level, format string, args ...interface{})
- func (l *Logger) Logln(level logrus.Level, 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) Trace(args ...interface{})
- func (l *Logger) Tracef(format string, args ...interface{})
- func (l *Logger) Traceln(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
- func (l *Logger) WithField(key string, value interface{}) *Logger
- func (l *Logger) WithFields(fields logrus.Fields) *Logger
- type TrackingInfo
Constants ¶
View Source
const (
LoggerTrackingKey = "logger-tracking"
)
Variables ¶
This section is empty.
Functions ¶
func WithFormatter ¶
func WithTracking ¶
func WithTracking(ctx context.Context, trackingInfo TrackingInfo) context.Context
Types ¶
type GORMLogger ¶
type GORMLogger struct { Config gorm.Config InfoStr string WarnStr string ErrStr string TraceStr string TraceWarnStr string TraceErrStr string }
func (*GORMLogger) Error ¶
func (g *GORMLogger) Error(ctx context.Context, msg string, data ...interface{})
func (*GORMLogger) Info ¶
func (g *GORMLogger) Info(ctx context.Context, msg string, data ...interface{})
func (*GORMLogger) Printf ¶
func (g *GORMLogger) Printf(ctx context.Context, msg string, data ...interface{})
type Logger ¶
func NewLoggerCtx ¶
NewLoggerCtx override existed logger key in ctx
func (*Logger) GetTrackingID ¶
type TrackingInfo ¶
Click to show internal directories.
Click to hide internal directories.