ctxzap

package
v5.0.0-...-b78520f Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StdoutLogger, _ = zap.NewProduction()
)

Functions

func Logger

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

Logger takes the call-scoped Logger from zap log middleware. It always returns a Logger that has all the zapcore.Field updated.

func WithFields

func WithFields(ctx context.Context, fields ...zapcore.Field)

WithFields adds zap fields to the logger.

func WithLogger

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

WithLogger adds the zap.Logger to the context for extraction later. Returning the new context that has been created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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