Documentation ¶
Overview ¶
Package almlog has the Almanack common logger
Index ¶
- Variables
- func FromContext(ctx context.Context) *slog.Logger
- func LevelThreshold[T time.Duration | int](val, warn, err T) slog.Level
- func Middleware(next http.Handler) http.Handler
- func NewContext(ctx context.Context, l *slog.Logger) context.Context
- func UseDevLogger()
- func UseLambdaLogger()
- func UseTestLogger(t testing.TB)
Constants ¶
This section is empty.
Variables ¶
View Source
var Level = &slog.LevelVar{}
View Source
var Logger *slog.Logger = slog.New(slog.NewTextHandler(initMe{}, nil))
Functions ¶
func FromContext ¶
FromContext returns the Logger stored in ctx by NewContext, or the default Logger if there is none.
func NewContext ¶
NewContext returns a context that contains the given Logger. Use FromContext to retrieve the Logger.
func UseDevLogger ¶
func UseDevLogger()
func UseLambdaLogger ¶
func UseLambdaLogger()
func UseTestLogger ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.