logging

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoggerFromCtx

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

GetLoggerFromCtx is a helper for pulling a logger from a context value

func RequestLoggerMiddleware

func RequestLoggerMiddleware(next http.Handler) http.Handler

RequestLoggerMiddleware is a middleware that injects a logger into the request's context which automatically includes a log group with request information

func SetupLogger

func SetupLogger(level string) *slog.Logger

SetupLogger builds a new slog.Logger which is configured at the log level according to the GOSHERVE_LOG_LEVEL environment variable

Types

This section is empty.

Jump to

Keyboard shortcuts

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