contextlogger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

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

From returns the *slog.Logger set on the context by New. If there is none, it returns a no-op logger that discards any output it receives.

func New

func New(ctx context.Context, logger *slog.Logger) context.Context

New saves the logger as a value to the context. This can then be retrieved through From.

Types

This section is empty.

Jump to

Keyboard shortcuts

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