func (l *logrusr) Info(msg string, keysAndValues ...interface{}) {
	if !l.Enabled() {
		return
	}
	l.logger.
		WithFields(listToLogrusFields(l.defaultFormatter, keysAndValues...)).
		Info(msg)
}
Info logs info messages if the logger is enabled, that is if the level on the
logger is set to logrus.InfoLevel or less.
package logrusr
import (
	"encoding/json"
	"strings"
	"github.com/go-logr/logr"
	"github.com/sirupsen/logrus"
)
const (
	logrusDiffToInfo = 4
)
type logrusr struct {
	name             []string
	level            int
	logger           logrus.FieldLogger
	defaultFormatter func(interface{}) string
}
func NewLogger(l logrus.FieldLogger, name ...string) logr.Logger {
	return NewLoggerWithFormatter(l, nil, name...)
}
func NewLoggerWithFormatter(l logrus.FieldLogger, formatter func(interface{}) string, name ...string) logr.Logger {
	return &logrusr{
		name:             name,
		level:            0,
		logger:           l,
		defaultFormatter: formatter,
	}
}
func (l *logrusr) Enabled() bool {
	var log *logrus.Logger
	switch t := l.logger.(type) {
	case *logrus.Logger:
		log = t
	case *logrus.Entry:
		log = t.Logger
	}
	return int(log.GetLevel())-logrusDiffToInfo >= l.level
}
func (l *logrusr) V(level int) logr.InfoLogger {
	l.level = level
	return l
}
func (l *logrusr) WithValues(keysAndValues ...interface{}) logr.Logger {
	l.logger = l.logger.WithFields(
		listToLogrusFields(l.defaultFormatter, keysAndValues...),
	)
	return l
}
func (l *logrusr) WithName(name string) logr.Logger {
	l.name = append(l.name, name)
	l.logger = l.logger.WithFields(logrus.Fields{
		"logger": strings.Join(l.name, "."),
	})
	return l
}