ctxlog

package
v0.0.0-...-3b91d86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *zap.Logger

FromContext gets a zap logger from a context. If none is set, then a nop logger is returned.

func FromContextWith

func FromContextWith(ctx context.Context, fields ...zap.Field) (context.Context, *zap.Logger)

FromContextWith gets a logger from a context, adds the specified fields, and returns context with the new logger.

func FromRequest

func FromRequest(r *http.Request) *zap.Logger

FromRequest gets a zap logger from a request's context. If none is set, then a nop logger is returned.

func Logger

func Logger(logger *zap.Logger) func(http.Handler) http.Handler

Logger adds a logger to a Handler chain.

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

WithLogger adds a zap logger to a context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL