Go to file
Vasiliy Tolstov 6252a2cdf2 move to micro v4
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-05-07 18:52:50 +03:00
.github Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 (#87) 2023-01-31 06:49:37 +03:00
.synced update micro to v3.1.3 2021-01-19 23:24:13 +03:00
go.mod move to micro v4 2023-05-07 18:52:50 +03:00
go.sum move to micro v4 2023-05-07 18:52:50 +03:00
LICENSE add LICENSE 2021-01-10 15:39:34 +03:00
logrus_test.go move to micro v4 2023-05-07 18:52:50 +03:00
logrus.go move to micro v4 2023-05-07 18:52:50 +03:00
options.go move to micro v4 2023-05-07 18:52:50 +03:00
README.md use own fork 2021-01-10 15:21:29 +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")
}