goalogrus

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

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

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL