Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LevelNotice is a custom slog level for notice messages.
	LevelNotice = slog.Level(10)
)

Variables

This section is empty.

Functions

func FromContext

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

FromContext returns the logger stored in the context, or the default logger if none is found.

func NewContext

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

NewContext returns a new context with the given logger attached.

func NewLogger

func NewLogger(opts config.LoggingOptions) (*slog.Logger, error)

NewLogger creates a new slog.Logger instance with the specified options.

Types

This section is empty.

Jump to

Keyboard shortcuts

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