traefik/pkg/logs/gokit.go

18 lines
374 B
Go
Raw Normal View History

2022-11-21 17:36:05 +00:00
package logs
import (
2024-07-22 07:34:51 +00:00
kitlog "github.com/go-kit/log"
2022-11-21 17:36:05 +00:00
"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
}
}