almlog

package
v0.0.0-...-16adccd Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package almlog has the Almanack common logger

Index

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

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

FromContext returns the Logger stored in ctx by NewContext, or the default Logger if there is none.

func LevelThreshold

func LevelThreshold[T time.Duration | int](val, warn, err T) slog.Level

func Middleware

func Middleware(next http.Handler) http.Handler

func NewContext

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

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

func UseTestLogger(t testing.TB)

Types

This section is empty.

Jump to

Keyboard shortcuts

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