logger

package
v0.0.0-...-d604252 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggerMid

func AddLoggerMid(logger *slog.Logger, next http.HandlerFunc) http.HandlerFunc

AddLoggerMid adds the logger to the request context.

func CtxWithLogger

func CtxWithLogger(ctx context.Context, logger *slog.Logger) context.Context

CtxWithLogger returns the context enriched with the logger.

func FromContext

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

FromContext fetch the logger from the context.

func Middleware

func Middleware(next http.Handler) http.HandlerFunc

Middleware request logging middleware.

Types

type CtxKey

type CtxKey struct{}

CtxKey for the logger.

Jump to

Keyboard shortcuts

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