logger

package
v0.0.0-...-3991c3e Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithZapLogger

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

ContextWithZapLogger returns a new context with a zap logger.

func ZapLogger

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

ZapLogger returns the zap logger stored in the context. If the logger does not exist, this function returns a NopLogger.

Types

type ZapLogMiddleware

type ZapLogMiddleware struct {
	Logger *zap.Logger
}

ZapLogMiddleware is a middleware which sets the zap logger in the context, allowing downstream middlewares and handler to access to a logger

func (ZapLogMiddleware) Chain

Jump to

Keyboard shortcuts

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