-
-
Save gbbr/935f26e50080ae99eedc822d8c273a89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func withLogging(next http.HandlerFunc) http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { | |
log.Printf("Logged connection from %s", r.RemoteAddr) | |
next.ServeHTTP(w, r) | |
} | |
} | |
func withTracing(next http.HandlerFunc) http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { | |
log.Printf("Tracing request for %s", r.RequestURI) | |
next.ServeHTTP(w, r) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment