mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +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) {
|
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 timer
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
path := c.Request.URL.Path
|
path := c.Request.URL.Path
|
||||||
@ -252,6 +246,11 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
|||||||
// Process request
|
// Process request
|
||||||
c.Next()
|
c.Next()
|
||||||
|
|
||||||
|
// Log only when it is not being skipped
|
||||||
|
if _, ok := skip[path]; ok || (conf.Skip != nil && conf.Skip(c)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
param := LogFormatterParams{
|
param := LogFormatterParams{
|
||||||
Request: c.Request,
|
Request: c.Request,
|
||||||
isTerm: isTerm,
|
isTerm: isTerm,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user