logrequest

package
v0.0.0-...-598a1f7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: AGPL-3.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TargetResponseTime = 1 * time.Second

TargetResponseTime sets the threshold for colorisation of response times

Functions

func Middleware

func Middleware(h http.HandlerFunc) http.HandlerFunc

Middleware logs after each request to record to log.Printf the method, the url, the status code and the response time e.g. GET / -> status 200 in 31.932146ms With coloration to indicate status and response time If ValueLoggers are set the values are also sent to log.Values

func MiddlewarePrint

func MiddlewarePrint(h http.HandlerFunc) http.HandlerFunc

MiddlewarePrint logs after each request to record to log.Printf the method, the url, the status code and the response time e.g. GET / -> status 200 in 31.932146ms With coloration to indicate status and response time No data is sent to value loggers

Types

This section is empty.

Jump to

Keyboard shortcuts

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