logger

package
v0.0.0-...-ae1b243 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 2 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 or the default logger

func WithContext

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

WithContext returns a new context with the logger

Types

type LoggedError

type LoggedError struct {
	// contains filtered or unexported fields
}

LoggedError is an error that has been logged

func Error

func Error(logger *slog.Logger, err error) *LoggedError

Error logs an error and returns a LoggedError that wraps the error to indicate that the error has been logged

func (*LoggedError) Error

func (e *LoggedError) Error() string

Jump to

Keyboard shortcuts

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