Documentation ¶
Index ¶
- Variables
- func AddLogFields(ctx context.Context, fields ...zap.Field)
- func AppendField(zapFields []zapcore.Field, key string, value string) []zapcore.Field
- func AppendZapField(zapFields []zapcore.Field, field zapcore.Field) []zapcore.Field
- func RpcLogger(extractor Extractor) grpc.UnaryServerInterceptor
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type ContextLogger
- func (ctxLogger *ContextLogger) AddFields(fields ...zap.Field)
- func (ctxLogger *ContextLogger) Debug(msg string, fields ...zap.Field)
- func (ctxLogger *ContextLogger) Error(msg string, fields ...zap.Field)
- func (ctxLogger *ContextLogger) Fatal(msg string, fields ...zap.Field)
- func (ctxLogger *ContextLogger) Info(msg string, fields ...zap.Field)
- func (ctxLogger *ContextLogger) Panic(msg string, fields ...zap.Field)
- func (ctxLogger *ContextLogger) Warn(msg string, fields ...zap.Field)
- type Error
- type Extractor
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = NewLogger( zap.NewExample().WithOptions(zap.Development()).With(zap.Bool("default", true)), )
Functions ¶
func AppendField ¶
func AppendZapField ¶
func RpcLogger ¶
func RpcLogger(extractor Extractor) grpc.UnaryServerInterceptor
Types ¶
type ContextLogger ¶
func NewContextLogger ¶
func NewContextLogger(logger Logger, fields ...zap.Field) *ContextLogger
func (*ContextLogger) AddFields ¶
func (ctxLogger *ContextLogger) AddFields(fields ...zap.Field)
func (*ContextLogger) Debug ¶
func (ctxLogger *ContextLogger) Debug(msg string, fields ...zap.Field)
func (*ContextLogger) Error ¶
func (ctxLogger *ContextLogger) Error(msg string, fields ...zap.Field)
func (*ContextLogger) Fatal ¶
func (ctxLogger *ContextLogger) Fatal(msg string, fields ...zap.Field)
type Logger ¶
Click to show internal directories.
Click to hide internal directories.