log

package
v1.14.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

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

FromContext returns a logger from a context.Context; if the passed context is nil, we return the default slog logger.

func IntoContext

func IntoContext(ctx context.Context, l *slog.Logger) context.Context

IntoContext adds a logger to a context. Use FromContext to pull the logger out.

func New

func New(name string) *slog.Logger

func NewContext

func NewContext(ctx context.Context, name string) context.Context

func NewHandler

func NewHandler(name string) slog.Handler

func SubLogger

func SubLogger(base *slog.Logger, suffix string) *slog.Logger

sublogger derives a new logger from an existing one by appending a suffix to its prefix.

Types

This section is empty.

Source Files

  • log.go

Jump to

Keyboard shortcuts

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