github.com/goadesign/goa/logging/kit


goakit

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

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 middlewares:
goakit.Logger(ctx).Log("foo", "bar")

Index

Package files

adapter.go

func Logger

func Logger(ctx context.Context) log.Logger

Logger returns the go-kit logger stored in the given context if any, nil otherwise.

func New

func New(logger log.Logger) goa.LogAdapter

New wraps a go-kit logger into a goa logger.


Generated by godoc2md