logctx

package
v0.0.0-...-8c7fe1e Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHandler slog.Handler
View Source
var PanicOnNullHandler bool

Functions

func Attr

func Attr(ctx context.Context, name string, value any) context.Context

Returns context with added slog attribute

func Context

func Context(ctx context.Context, handler slog.Handler) context.Context

Creates a new context with the given handler added to it

func Debug

func Debug(ctx context.Context, msg string, args ...any)

Log a Debug record using handler from context

func Error

func Error(ctx context.Context, msg string, args ...any)

Log an Error record using handler from context

func Handler

func Handler(ctx context.Context) slog.Handler

Gets Handler from context (or use the default if one isn't set)

func Info

func Info(ctx context.Context, msg string, args ...any)

Log an Info record using handler from context

func Warn

func Warn(ctx context.Context, msg string, args ...any)

Log a Warn record using handler from context

Types

This section is empty.

Jump to

Keyboard shortcuts

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