New logger for the Traefik logs
This commit is contained in:
parent
27c02b5a56
commit
56f7515ecd
297 changed files with 2337 additions and 1934 deletions
17
pkg/logs/gokit.go
Normal file
17
pkg/logs/gokit.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package logs
|
||||
|
||||
import (
|
||||
kitlog "github.com/go-kit/kit/log"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
func NewGoKitWrapper(logger zerolog.Logger) kitlog.LoggerFunc {
|
||||
if logger.GetLevel() > zerolog.DebugLevel {
|
||||
return func(args ...interface{}) error { return nil }
|
||||
}
|
||||
|
||||
return func(args ...interface{}) error {
|
||||
logger.Debug().CallerSkipFrame(2).MsgFunc(msgFunc(args...))
|
||||
return nil
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue