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.
Click to show internal directories.
Click to hide internal directories.