Documentation ¶
Overview ¶
ctxlog provides context-aware logging. Loosely based on https://github.com/containerd/containerd/blob/master/log/context.go
Index ¶
- Variables
- func Logger(ctx context.Context) *logrus.Entry
- func WithField(ctx context.Context, key string, value interface{}) context.Context
- func WithFields(ctx context.Context, fields logrus.Fields) context.Context
- func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context
- type Fields
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // L is an alias for Logger. L = Logger )
Functions ¶
func Logger ¶
Logger retrieves the current logger from the context. If no logger is available, the default logger is returned.
func WithField ¶
WithField returns a new context with the provided field set in the existing logger.
func WithFields ¶
WithFields returns a new context with the provided fields set in the existing logger.
Types ¶
Click to show internal directories.
Click to hide internal directories.