github.com/goadesign/goa/logging/logrus
goalogrus
import "github.com/goadesign/goa/logging/logrus"
Overview
Package goalogrus contains an adapter that makes it possible to configure goa so it uses logrus as logger backend. Usage:
logger := logrus.New()
// Initialize logger handler using logrus package
service.WithLogger(goalogrus.New(logger))
// ... Proceed with configuring and starting the goa service
// In handlers:
goalogrus.Entry(ctx).Info("foo", "bar")
Index
- func Entry(ctx context.Context) *logrus.Entry
- func FromEntry(entry *logrus.Entry) goa.LogAdapter
- func New(logger *logrus.Logger) goa.LogAdapter
Package files
func Entry
func Entry(ctx context.Context) *logrus.Entry
Entry returns the logrus log entry stored in the given context if any, nil otherwise.
func FromEntry
func FromEntry(entry *logrus.Entry) goa.LogAdapter
FromEntry wraps a logrus log entry into a goa logger.
func New
func New(logger *logrus.Logger) goa.LogAdapter
New wraps a logrus logger into a goa logger.
Generated by godoc2md