micro-logger-logrus/README.md
Vasiliy Tolstov c6d4eb6586 use own fork
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-10 15:21:29 +03:00

595 B

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")
}