mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-17 15:37:29 +08:00
Better documentation
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user