mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
do not ignore skip func delay in latency calculation
This commit is contained in:
parent
a97eec4055
commit
23da40cfaf
11
logger.go
11
logger.go
@ -238,12 +238,6 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
||||
}
|
||||
|
||||
return func(c *Context) {
|
||||
// Log only when it is not being skipped
|
||||
if _, ok := skip[c.Request.URL.Path]; ok || (conf.Skip != nil && conf.Skip(c)) {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
// Start timer
|
||||
start := time.Now()
|
||||
path := c.Request.URL.Path
|
||||
@ -252,6 +246,11 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
||||
// Process request
|
||||
c.Next()
|
||||
|
||||
// Log only when it is not being skipped
|
||||
if _, ok := skip[path]; ok || (conf.Skip != nil && conf.Skip(c)) {
|
||||
return
|
||||
}
|
||||
|
||||
param := LogFormatterParams{
|
||||
Request: c.Request,
|
||||
isTerm: isTerm,
|
||||
|
Loading…
x
Reference in New Issue
Block a user