Documentation
¶
Overview ¶
Package ctxlog provides context-scoped logging.
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 FromContext(ctx context.Context) *zap.Logger
- func Info(ctx context.Context, msg string, fields ...zap.Field)
- func New(debug bool) *zap.Logger
- func NewUnsampled(debug bool) *zap.Logger
- func NoTrace() zap.Option
- func PlainError(err error) zap.Field
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- func With(ctx context.Context, fields ...zap.Field) context.Context
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- func WithOptions(ctx context.Context, opts ...zap.Option) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext gets a zap logger from a context. If none is set, then a nop logger is returned. The Debug, Error, With, WithOptions, etc, functions should be preferred over using this function to access a logger.
func NewUnsampled ¶
NewUnsampled creates a new zap logger with sampling disabled.
func PlainError ¶
PlainError is like zap.Error, but won't also include extra debugging info (which is duplicated in some logging levels).
func WithLogger ¶
WithLogger adds a zap logger to a context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.