A logr implementation using logrus.
import (
"github.com/bombsimon/logrusr/v4"
"github.com/go-logr/logr"
"github.com/sirupsen/logrus"
)
func main() {
logrusLog := logrus.New()
log := logrusr.New(logrusLog)
log = log.WithName("MyName").WithValues("user", "you")
log.Info("Logr in action!", "the answer", 42)
}
For more details, see example.
The New method takes a logrus.FieldLogger
interface as input which means
this works with both logrus.Logger
and logrus.Entry
. This is currently a
quite naive implementation in early state. Use with caution.