log

package
v0.0.5-alpha Latest Latest
Warning

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

Go to latest
Published: May 25, 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(rctx context.Context) *slog.Logger

FromContext gets the logger from the context If the logger is not found in the context, a new logger is created and set to the context

func New

func New() *slog.Logger

NewLogger creates a new logger with the default settings The logger is configured to log to stdout in JSON format The log level is set to the value of the ZERO_LOG_LEVEL environment variable If the ZERO_LOG_LEVEL environment variable is not set, the log level is set to INFO

func SetToContext

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

SetToContext sets the logger to the context

func WithArgs

func WithArgs(ctx context.Context, args ...any) context.Context

WithArgs adds the given arguments to the logger in 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