-
-
Save parzibyte/54459849a0405d4a8418f1649ba3343a 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 middlewareLog(siguienteManejador http.Handler) http.Handler { | |
return http.HandlerFunc( | |
func(respuesta http.ResponseWriter, peticion *http.Request) { | |
log.Printf("Nueva petición. Método: %s. IP: %s. URL solicitada: %s\n", | |
peticion.Method, peticion.RemoteAddr, peticion.URL) | |
siguienteManejador.ServeHTTP(respuesta, peticion) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment