1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/plugins/logger/logrus
2021-01-20 21:01:10 +00:00
..
go.mod update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00
go.sum update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00
logrus_test.go update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00
logrus.go update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00
options.go update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00
README.md update v3 plugins (#2105) 2021-01-20 21:01:10 +00:00

logrus

logrus logger implementation for go-micro meta logger.

Usage

import (
	"os"
	"github.com/sirupsen/logrus"
	"github.com/asim/go-micro/v3/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")
}