goakit

package
v0.0.0-...-374a2f1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package goakit contains an adapter that makes it possible to configure goa so it uses the go-kit log package as logger backend. Usage:

// Initialize logger using github.com/go-kit/kit/log package
logger := log.NewLogfmtLogger(w)
// Initialize goa service logger using adapter
service.WithLogger(goakit.New(logger))
// ... Proceed with configuring and starting the goa service

// In handlers:
goakit.Context(ctx).Log("foo", "bar")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context) *log.Context

Context returns the go-kit log context stored in the given context if any, nil otherwise.

func FromContext

func FromContext(ctx *log.Context) goa.LogAdapter

FromContext wraps a go-kit log context into a goa logger.

func New

func New(logger log.Logger) goa.LogAdapter

New wraps a go-kit 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