ctxlogger

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ctxlogger provides an htadaptor.Middleware that injects a given logger into context so that it can be recovered later in the stack for use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

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

func New

func New(logger *slog.Logger) htadaptor.Middleware

New creates an htadaptor.Middleware that injects slog.Logger into request context so it can be recovered later using FromContext.

func NewContext

func NewContext(parent context.Context, l *slog.Logger) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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