gin-gonic/gin — pull request #16 by zmarcantel (2014-07-02 01:46:16+00:00)
Title: Wrap http.ResponseWriter to greatly increase middleware/logging accesibilty

The returning status is hidden in http.ResponseWriter, but it's easy to wrap.

This follows Martini and other packages practice and allows giving access to many variables.
I have only included .Status() as an example, but Martini has body length and a few others.

There is also an example of an extended logger working as a middleware using the .Status() function to color output based on status code.
This examples could easily extend to other middleware that "fork" handling based on a specific status such as:

1. monitoring
2. logging
3. intrusion detection
4. internal health checks
4. etc