loggingctx

package
v0.0.0-...-68fadb2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(parent 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 NewHandler

func NewHandler() *ctxHandler

Create a new handler instance This handler simply uses the supplied ctx to check for a Handler and uses it This handler can be used directly or installed as slog.Default()

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