Documentation ¶
Index ¶
- type Logger
- func NewLogger(options ...Option) *Logger
- func NewMysqlLogger(c *MysqlLoggerConfig, level gormLogger.LogLevel) *Logger
- func NewMysqlSlowLogger(c *MysqlSlowLoggerConfig) *Logger
- func NewRedisLogger(c *RedisLoggerConfig, level logrus.Level) *Logger
- func NewRedisSlowLogger(c *RedisSlowLoggerConfig) *Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) For(ctx context.Context) *logrus.Entry
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) LogFileNameFormat(level logrus.Level) string
- func (l *Logger) LogLinkNameFormat(level logrus.Level) string
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(format string, 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) WithFields(args logrus.Fields) *logrus.Entry
- type MysqlLoggerConfig
- type MysqlSlowLoggerConfig
- type Option
- func WithDisplayTerminal(displayTerminal bool) Option
- func WithFileName(fileName string) Option
- func WithFileNameFormat(format string) Option
- func WithFilePath(filePath string) Option
- func WithLevel(level logrus.Level) Option
- func WithMaxAge(maxAge time.Duration) Option
- func WithRotationTime(rotationTime time.Duration) Option
- func WithSetReportCaller(reportCaller bool) Option
- type RedisLoggerConfig
- type RedisSlowLoggerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewMysqlLogger ¶
func NewMysqlLogger(c *MysqlLoggerConfig, level gormLogger.LogLevel) *Logger
func NewMysqlSlowLogger ¶
func NewMysqlSlowLogger(c *MysqlSlowLoggerConfig) *Logger
func NewRedisLogger ¶
func NewRedisLogger(c *RedisLoggerConfig, level logrus.Level) *Logger
func NewRedisSlowLogger ¶
func NewRedisSlowLogger(c *RedisSlowLoggerConfig) *Logger
func (*Logger) LogFileNameFormat ¶
LogFileNameFormat 日志名格式化
func (*Logger) LogLinkNameFormat ¶
LogLinkNameFormat 日志名格式化
type MysqlLoggerConfig ¶
type MysqlSlowLoggerConfig ¶
type Option ¶
type Option func(*Logger)
func WithDisplayTerminal ¶
func WithFileName ¶
func WithFileNameFormat ¶
func WithFilePath ¶
func WithMaxAge ¶
func WithRotationTime ¶
func WithSetReportCaller ¶
type RedisLoggerConfig ¶
type RedisSlowLoggerConfig ¶
Click to show internal directories.
Click to hide internal directories.