mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 23:59:43 +08:00
Address PR feedback: remove redundant files, format code, add progress tracking
Co-authored-by: krau <71133316+krau@users.noreply.github.com>
This commit is contained in:
@@ -54,12 +54,12 @@ func loggingMiddleware(logger *log.Logger) func(http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
start := time.Now()
|
||||
|
||||
|
||||
// Wrap response writer to capture status code
|
||||
wrapper := &responseWriter{ResponseWriter: w, statusCode: http.StatusOK}
|
||||
|
||||
|
||||
next.ServeHTTP(wrapper, r)
|
||||
|
||||
|
||||
logger.Infof("%s %s %d %s", r.Method, r.URL.Path, wrapper.statusCode, time.Since(start))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user