ctxlog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCtx

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

AppendCtx adds an slog attribute to the provided context so that it will be included in any Record created with such context

Types

type ContextHandler

type ContextHandler struct {
	slog.Handler
}

func (ContextHandler) Handle

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

Handle adds contextual attributes to the Record before calling the underlying handler

Jump to

Keyboard shortcuts

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