Go to file
Vasiliy Tolstov eb5a19c44d bump go-micro and micro to v2.3.0 (#510)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-10 14:58:14 +03:00
go.mod bump go-micro and micro to v2.3.0 (#510) 2021-01-10 14:58:14 +03:00
go.sum bump go-micro and micro to v2.3.0 (#510) 2021-01-10 14:58:14 +03:00
logrus_test.go bump go-micro and micro to v2.3.0 (#510) 2021-01-10 14:58:14 +03:00
logrus.go allow to initialize Logger with existing logrus Logger or Entry (#500) 2021-01-10 14:57:28 +03:00
options.go allow to initialize Logger with existing logrus Logger or Entry (#500) 2021-01-10 14:57:28 +03:00
README.md allow to initialize Logger with existing logrus Logger or Entry (#500) 2021-01-10 14:57:28 +03:00

logrus

logrus logger implementation for go-micro meta logger.

Usage

import (
	"os"
	"github.com/sirupsen/logrus"
	"github.com/micro/go-micro/v2/logger"
)

func ExampleWithOutput() {
  logger.DefaultLogger = NewLogger(logger.WithOutput(os.Stdout))
  logger.Infof(logger.InfoLevel, "testing: %s", "Infof")
}

func ExampleWithLogger() {
	l:= logrus.New() // *logrus.Logger
	logger.DefaultLogger = NewLogger(WithLogger(l))
  logger.Infof(logger.InfoLevel, "testing: %s", "Infof")
}