goazap

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: MIT Imports: 4 Imported by: 0

README

Build Status

Documentation

Overview

Package goazap contains an adapter that makes it possible to configure goa so it uses zap as logger backend. Usage:

    logger, err := zap.NewProduction()
	...
    // Initialize logger handler using zap package
    service.WithLogger(goazap.New(logger))
    // ... Proceed with configuring and starting the goa service

    // In handlers:
    goazap.Logger(ctx).Info("foo")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(ctx context.Context) *zap.Logger

Logger returns the zap logger stored in the given context if any, nil otherwise.

func New

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

New wraps a zap logger into a goa logger adapter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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