log

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 3 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 the logger from the context. Be sure to check for a nil return value in case a logger has not been set with ToContext()

func FromContextOrDefault

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

FromContextOrDefault() returns the *slog.Logger from FromContext() or the default logger if nil was returned

func SetLevel

func SetLevel(l slog.Level)

SetLevel sets the log level

func ToContext

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

ToContext adds the logger to the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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