logger

package
v0.0.0-...-435223f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggerHook

func AddLoggerHook(fns ...func(zapcore.Entry) error)

AddLoggerHook 会将传进的参数在每一次日志输出后执行

func BuildLogger

func BuildLogger(cfg *config, opts ...zap.Option) *zap.Logger

func Debug

func Debug(msg string, fields ...zap.Field)

func Debugf

func Debugf(template string, args ...interface{})

func Error

func Error(msg string, fields ...zap.Field)

func Errorf

func Errorf(template string, args ...interface{})

func Fatal

func Fatal(msg string, fields ...zap.Field)

func Fatalf

func Fatalf(template string, args ...interface{})

func Info

func Info(msg string, fields ...zap.Field)

func Infof

func Infof(template string, args ...interface{})

func Init

func Init(service string, level string)

func LError

func LError(msg string, fields ...zap.Field)

LError equals Error less one stack

func Warn

func Warn(msg string, fields ...zap.Field)

func Warnf

func Warnf(template string, args ...interface{})

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL