mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-04-05 01:10:12 -05:00
33 lines
525 B
Go
33 lines
525 B
Go
/*
|
|
* Bitbucket Server API
|
|
*
|
|
* Bitbucket Server API (former stash).
|
|
*
|
|
* API version: 1.0.0
|
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
|
*/
|
|
|
|
package swagger
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
func Logger(inner http.Handler, name string) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
start := time.Now()
|
|
|
|
inner.ServeHTTP(w, r)
|
|
|
|
log.Printf(
|
|
"%s %s %s %s",
|
|
r.Method,
|
|
r.RequestURI,
|
|
name,
|
|
time.Since(start),
|
|
)
|
|
})
|
|
}
|