Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
yarf.Middleware
}
Logger middleware it's a simple log module that uses the default golang's log package. The log output writer can be defined by default with the log.SetOutput(w io.Writer) function. For more complex environments where a default logger can't be used across the system, a custom solution to replace this should be implemented.
type LoggerWriter ¶
type LoggerWriter struct { StatusCode int Writer http.ResponseWriter }
LoggerWriter will replace (wrap) the http.ResponseWriter to log all content written to the response.
func (*LoggerWriter) Header ¶
func (lw *LoggerWriter) Header() http.Header
Header is a wrapper for http.ResponseWriter.Header()
func (*LoggerWriter) Write ¶
func (lw *LoggerWriter) Write(content []byte) (int, error)
Write is a wrapper for
func (*LoggerWriter) WriteHeader ¶
func (lw *LoggerWriter) WriteHeader(code int)
WriteHeader is a wrapper for http.ResponseWriter.WriteHeader() It saves the status code to be returned so we can log it.
Click to show internal directories.
Click to hide internal directories.