1 /* 2 * GoBun File Store 3 * 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 * 6 * API version: 0.0.1 7 * Generated by: OpenAPI Generator (https://openapi-generator.tech) 8 */ 9 10 package openapi 11 12 import ( 13 "log" 14 "net/http" 15 "time" 16 ) 17 18 func Logger(inner http.Handler, name string) http.Handler { 19 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 20 start := time.Now() 21 22 inner.ServeHTTP(w, r) 23 24 log.Printf( 25 "%s %s %s %s", 26 r.Method, 27 r.RequestURI, 28 name, 29 time.Since(start), 30 ) 31 }) 32 } 33