Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Mar 2, 2024
1 parent 1015fc7 commit d4536f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ func GinzapWithConfig(logger ZapLogger, conf *Config) gin.HandlerFunc {
path := c.Request.URL.Path
query := c.Request.URL.RawQuery
c.Next()
track := true

if _, ok := skipPaths[path]; !ok && (conf.Skipper != nil && !conf.Skipper(c)) {
if _, ok := skipPaths[path]; ok || (conf.Skipper != nil && conf.Skipper(c)) {
track = false
}

if track {
end := time.Now()
latency := end.Sub(start)
if conf.UTC {
Expand Down

0 comments on commit d4536f0

Please sign in to comment.