Documentation
¶
Index ¶
- func FromContext(ctx context.Context) *zap.Logger
- func FromContextWith(ctx context.Context, fields ...zap.Field) (context.Context, *zap.Logger)
- func FromRequest(r *http.Request) *zap.Logger
- func Logger(logger *zap.Logger) func(http.Handler) http.Handler
- func WithLogger(ctx context.Context, logger *zap.Logger) 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.
func FromContextWith ¶
FromContextWith gets a logger from a context, adds the specified fields, and returns context with the new logger.
func FromRequest ¶
FromRequest gets a zap logger from a request's context. If none is set, then a nop logger is returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.