Documentation
¶
Index ¶
- func WithFields(ctx context.Context, fields ...Field) context.Context
- type CtxLogger
- type Field
- func ExtractFields(ctx context.Context, fields ...Field) []Field
- func NewBoolField(key string, value bool) Field
- func NewErrorField(key string, value error) Field
- func NewFloat64Field(key string, value float64) Field
- func NewInt64Field(key string, value int64) Field
- func NewIntField(key string, value int) Field
- func NewStringField(key string, value string) Field
- func NewTimeField(key string, value time.Time) Field
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CtxLogger ¶
type CtxLogger interface {
DebugCtx(ctx context.Context, msg string, fields ...Field)
InfoCtx(ctx context.Context, msg string, fields ...Field)
WarnCtx(ctx context.Context, msg string, fields ...Field)
ErrorCtx(ctx context.Context, msg string, fields ...Field)
PanicCtx(ctx context.Context, msg string, fields ...Field)
FatalCtx(ctx context.Context, msg string, fields ...Field)
}
CtxLogger по сути тот же интерфейс Logger, только методы CtxLogger первым аргументом принимают контекст, где находятся поля логгера
type Field ¶
Field Поле context-based логгера
func NewBoolField ¶
func NewErrorField ¶
func NewFloat64Field ¶
func NewInt64Field ¶
func NewIntField ¶
func NewStringField ¶
Click to show internal directories.
Click to hide internal directories.