Documentation ¶
Index ¶
- func AddLoggerHook(fns ...func(zapcore.Entry) error)
- func BuildLogger(cfg *config, opts ...zap.Option) *zap.Logger
- func Debug(msg string, fields ...zap.Field)
- func Debugf(template string, args ...interface{})
- func Error(msg string, fields ...zap.Field)
- func Errorf(template string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(template string, args ...interface{})
- func Info(msg string, fields ...zap.Field)
- func Infof(template string, args ...interface{})
- func Init(service string, level string)
- func LError(msg string, fields ...zap.Field)
- func Warn(msg string, fields ...zap.Field)
- func Warnf(template string, args ...interface{})
- type KlogLogger
- func (l *KlogLogger) CtxDebugf(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxErrorf(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxFatalf(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxInfof(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxNoticef(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxTracef(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) CtxWarnf(ctx context.Context, format string, v ...interface{})
- func (l *KlogLogger) Debug(v ...interface{})
- func (l *KlogLogger) Debugf(format string, v ...interface{})
- func (l *KlogLogger) Error(v ...interface{})
- func (l *KlogLogger) Errorf(format string, v ...interface{})
- func (l *KlogLogger) Fatal(v ...interface{})
- func (l *KlogLogger) Fatalf(format string, v ...interface{})
- func (l *KlogLogger) Info(v ...interface{})
- func (l *KlogLogger) Infof(format string, v ...interface{})
- func (l *KlogLogger) Notice(v ...interface{})
- func (l *KlogLogger) Noticef(format string, v ...interface{})
- func (l *KlogLogger) SetLevel(klog.Level)
- func (l *KlogLogger) SetOutput(io.Writer)
- func (l *KlogLogger) Trace(v ...interface{})
- func (l *KlogLogger) Tracef(format string, v ...interface{})
- func (l *KlogLogger) Warn(v ...interface{})
- func (l *KlogLogger) Warnf(format string, v ...interface{})
- type MysqlLogger
- type RedisLogger
- func (l *RedisLogger) DialHook(next redis.DialHook) redis.DialHook
- func (l *RedisLogger) Printf(ctx context.Context, template string, args ...interface{})
- func (l *RedisLogger) ProcessHook(next redis.ProcessHook) redis.ProcessHook
- func (l *RedisLogger) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLoggerHook ¶
AddLoggerHook 会将传进的参数在每一次日志输出后执行
Types ¶
type KlogLogger ¶
type KlogLogger struct{}
func GetKlogLogger ¶
func GetKlogLogger() *KlogLogger
func (*KlogLogger) CtxDebugf ¶
func (l *KlogLogger) CtxDebugf(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxErrorf ¶
func (l *KlogLogger) CtxErrorf(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxFatalf ¶
func (l *KlogLogger) CtxFatalf(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxInfof ¶
func (l *KlogLogger) CtxInfof(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxNoticef ¶
func (l *KlogLogger) CtxNoticef(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxTracef ¶
func (l *KlogLogger) CtxTracef(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) CtxWarnf ¶
func (l *KlogLogger) CtxWarnf(ctx context.Context, format string, v ...interface{})
func (*KlogLogger) Debug ¶
func (l *KlogLogger) Debug(v ...interface{})
func (*KlogLogger) Debugf ¶
func (l *KlogLogger) Debugf(format string, v ...interface{})
func (*KlogLogger) Error ¶
func (l *KlogLogger) Error(v ...interface{})
func (*KlogLogger) Errorf ¶
func (l *KlogLogger) Errorf(format string, v ...interface{})
func (*KlogLogger) Fatal ¶
func (l *KlogLogger) Fatal(v ...interface{})
func (*KlogLogger) Fatalf ¶
func (l *KlogLogger) Fatalf(format string, v ...interface{})
func (*KlogLogger) Info ¶
func (l *KlogLogger) Info(v ...interface{})
func (*KlogLogger) Infof ¶
func (l *KlogLogger) Infof(format string, v ...interface{})
func (*KlogLogger) Notice ¶
func (l *KlogLogger) Notice(v ...interface{})
func (*KlogLogger) Noticef ¶
func (l *KlogLogger) Noticef(format string, v ...interface{})
func (*KlogLogger) SetLevel ¶
func (l *KlogLogger) SetLevel(klog.Level)
func (*KlogLogger) SetOutput ¶
func (l *KlogLogger) SetOutput(io.Writer)
func (*KlogLogger) Trace ¶
func (l *KlogLogger) Trace(v ...interface{})
func (*KlogLogger) Tracef ¶
func (l *KlogLogger) Tracef(format string, v ...interface{})
func (*KlogLogger) Warn ¶
func (l *KlogLogger) Warn(v ...interface{})
func (*KlogLogger) Warnf ¶
func (l *KlogLogger) Warnf(format string, v ...interface{})
type MysqlLogger ¶
type MysqlLogger struct{}
func GetMysqlLogger ¶
func GetMysqlLogger() *MysqlLogger
func (*MysqlLogger) Printf ¶
func (l *MysqlLogger) Printf(template string, args ...interface{})
type RedisLogger ¶
type RedisLogger struct{}
RedisLogger 不加入自定义的 logger 字段, 以使得 logger 更新后无指针引用
func GetRedisLogger ¶
func GetRedisLogger() *RedisLogger
func (*RedisLogger) DialHook ¶
func (l *RedisLogger) DialHook(next redis.DialHook) redis.DialHook
func (*RedisLogger) Printf ¶
func (l *RedisLogger) Printf(ctx context.Context, template string, args ...interface{})
func (*RedisLogger) ProcessHook ¶
func (l *RedisLogger) ProcessHook(next redis.ProcessHook) redis.ProcessHook
func (*RedisLogger) ProcessPipelineHook ¶
func (l *RedisLogger) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook
Click to show internal directories.
Click to hide internal directories.