1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-08 15:36:47 +00:00
文件
tunasync/manager/middleware.go
2016-04-30 16:41:10 +08:00

17 行
348 B
Go

package manager
import (
"github.com/gin-gonic/gin"
)
func contextErrorLogger(c *gin.Context) {
errs := c.Errors.ByType(gin.ErrorTypeAny)
if len(errs) > 0 {
for _, err := range errs {
logger.Error(`"in request "%s %s: %s"`, c.Request.Method, c.Request.URL.Path, err.Error())
}
}
// pass on to the next middleware in chain
c.Next()
}