forked from mirror/gin
Plural is "Paths", not "Pathes" (#1706)
This commit is contained in:
parent
1542eff27f
commit
678e09c736
|
@ -35,9 +35,9 @@ type LoggerConfig struct {
|
|||
// Optional. Default value is gin.DefaultWriter.
|
||||
Output io.Writer
|
||||
|
||||
// SkipPathes is a url path array which logs are not written.
|
||||
// SkipPaths is a url path array which logs are not written.
|
||||
// Optional.
|
||||
SkipPathes []string
|
||||
SkipPaths []string
|
||||
}
|
||||
|
||||
// LogFormatter gives the signature of the formatter function passed to LoggerWithFormatter
|
||||
|
@ -115,7 +115,7 @@ func LoggerWithFormatter(f LogFormatter) HandlerFunc {
|
|||
func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
|
||||
return LoggerWithConfig(LoggerConfig{
|
||||
Output: out,
|
||||
SkipPathes: notlogged,
|
||||
SkipPaths: notlogged,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
|||
out = DefaultWriter
|
||||
}
|
||||
|
||||
notlogged := conf.SkipPathes
|
||||
notlogged := conf.SkipPaths
|
||||
|
||||
isTerm := true
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ func TestLoggerWithConfigSkippingPaths(t *testing.T) {
|
|||
router := New()
|
||||
router.Use(LoggerWithConfig(LoggerConfig{
|
||||
Output: buffer,
|
||||
SkipPathes: []string{"/skipped"},
|
||||
SkipPaths: []string{"/skipped"},
|
||||
}))
|
||||
router.GET("/logged", func(c *Context) {})
|
||||
router.GET("/skipped", func(c *Context) {})
|
||||
|
|
Loading…
Reference in New Issue