Skip to content

Commit

Permalink
Adding print statements of status collect middleware to stderr
Browse files Browse the repository at this point in the history
Co-authored-by: Susanne Salzmann <[email protected]>
  • Loading branch information
salzmannsusan committed Mar 23, 2023
1 parent e56ead9 commit 15f73a0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package healthendpoint
import (
"fmt"
"net/http"
"os"
)

type HTTPStatusCollectMiddleware struct {
Expand All @@ -19,8 +20,9 @@ func (h *HTTPStatusCollectMiddleware) Collect(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
h.httpStatusCollector.IncConcurrentHTTPRequest()
defer h.httpStatusCollector.DecConcurrentHTTPRequest()
fmt.Printf("\n\nCHECKING w\n\n %s \n", w)
fmt.Printf("\n\nCHECKING r\n\n %s \n", r)
fmt.Fprintf(os.Stderr, "\n\nCHECKING w\n\n %v \n", w)
fmt.Fprintf(os.Stderr, "\n\nCHECKING r\n\n %v \n", r)
fmt.Fprintf(os.Stderr, "\n\nnext\n\n %v \n", next)
next.ServeHTTP(w, r)
})
}

0 comments on commit 15f73a0

Please sign in to comment.