traefik/pkg/logs/gokit.go
2022-11-21 18:36:05 +01:00

17 lines
378 B
Go

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
}
}