A logr implementation using logrus.
import (
"github.com/sirupsen/logrus"
"github.com/bombsimon/logrusr"
"github.com/go-logr/logr"
)
func main() {
var log logr.Logger
log = logrusr.NewLogger(logrus.New())
log.Info("Logr in action!", "the answer", 42)
}
For more details, see example.
The NewLogger 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.