Documentation
¶
Index ¶
- func Debug(ctx context.Context, msg string, fields ...zap.Field)
- func Error(ctx context.Context, msg string, fields ...zap.Field)
- func Fatal(ctx context.Context, msg string, fields ...zap.Field)
- func Info(ctx context.Context, msg string, fields ...zap.Field)
- func InitLogger(cfg *config.LoggerConfig) error
- func SysDebug(msg string, fields ...zap.Field)
- func SysError(msg string, fields ...zap.Field)
- func SysFatal(msg string, fields ...zap.Field)
- func SysInfo(msg string, fields ...zap.Field)
- func SysLog(msg string, fields ...zap.Field)
- func SysWarn(msg string, fields ...zap.Field)
- func ToZapField(key string, value interface{}) zap.Field
- func ToZapFields(data map[string]interface{}) []zap.Field
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToZapField ¶
ToZapField 根据 value 的具体类型将 key-value 对转换为 zap.Field
func ToZapFields ¶
ToZapFields 将 map[string]interface{} 中的所有键值对转换为 zap.Field 切片
Types ¶
type Logger ¶
type Logger interface {
Debug(ctx context.Context, msg string, fields ...zap.Field)
Info(ctx context.Context, msg string, fields ...zap.Field)
Warn(ctx context.Context, msg string, fields ...zap.Field)
Error(ctx context.Context, msg string, fields ...zap.Field)
Fatal(ctx context.Context, msg string, fields ...zap.Field)
}
Logger 定义了日志接口,调用方只需依赖此接口
Click to show internal directories.
Click to hide internal directories.