logging

package
v0.0.0-...-4611303 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCtx

func AppendCtx(parent context.Context, attrs ...slog.Attr) context.Context

AppendCtx appends slog.Attrs to the context, to be used in logging handlers.

func RequestLoggerConfig

func RequestLoggerConfig(logger *slog.Logger) middleware.RequestLoggerConfig

Types

type ContextHandler

type ContextHandler struct {
	slog.Handler
}

ContextHandler is a slog.Handler that appends slog.Attrs to the context, to be used in logging handlers.

func (*ContextHandler) Handle

func (h *ContextHandler) Handle(ctx context.Context, r slog.Record) error

Jump to

Keyboard shortcuts

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