in log/access_logger.go [17:34]
func AccessLogger(h http.Handler, opts ...AccessLoggerOption) http.Handler {
config := applyAccessLoggerOptions(opts)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var bodyLength atomic.Int64
r.Body = &bodyByteCounter{
body: r.Body,
count: &bodyLength,
}
lrw := newLoggingResponseWriter(w, &config, &bodyLength)
defer lrw.requestFinished(r)
h.ServeHTTP(lrw, r)
lrw.setStatus()
})
}