goa: github.com/goadesign/goa/logging/logrus Index | Files

package goalogrus

import "github.com/goadesign/goa/logging/logrus"

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

Package Files

adapter.go

func Entry Uses

func Entry(ctx context.Context) *logrus.Entry

Entry returns the logrus log entry stored in the given context if any, nil otherwise.

func FromEntry Uses

func FromEntry(entry *logrus.Entry) goa.LogAdapter

FromEntry wraps a logrus log entry into a goa logger.

func New Uses

func New(logger *logrus.Logger) goa.LogAdapter

New wraps a logrus logger into a goa logger.

Package goalogrus imports 4 packages (graph) and is imported by 2 packages. Updated 2017-06-26. Refresh now. Tools for package owners.