logging

package
v0.0.0-...-9779743 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogger

func DefaultLogger() *slog.Logger

DefaultLogger returns the default logger for the package.

func LoggerFromContext

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

LoggerFromContext returns the logger stored in the context. If no logger exists, a default logger is returned.

func LoggerWithContext

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

LoggerWithContext create a new context with the provided logger attached.

func NewLogger

func NewLogger(dev bool, level string) *slog.Logger

NewLogger creates and returns a new instance of logger with custom configurations.

func NewLoggerFromEnv

func NewLoggerFromEnv() *slog.Logger

NewLoggerFromEnv creates a new logger by evaluating a few environment variables to determine some of the custom configurations available to be set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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