Better documentation

This commit is contained in:
Manu Mtz-Almeida
2015-05-29 21:03:41 +02:00
parent 66e9feb622
commit 48633f7001
5 changed files with 41 additions and 4 deletions

View File

@ -38,10 +38,14 @@ func ErrorLoggerT(typ ErrorType) HandlerFunc {
}
}
// Instances a Logger middleware that will write the logs to gin.DefaultWriter
// By default gin.DefaultWriter = os.Stdout
func Logger() HandlerFunc {
return LoggerWithWriter(DefaultWriter)
}
// Instance a Logger middleware with the specified writter buffer.
// Example: os.Stdout, a file opened in write mode, a socket...
func LoggerWithWriter(out io.Writer) HandlerFunc {
return func(c *Context) {
// Start timer