grpczap

package module
v0.0.0-...-0da1d84 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2016 License: MIT Imports: 4 Imported by: 0

README

grpczap

Under development.

Usage

import (
	"github.com/uber-go/zap"
	"github.com/kazegusuri/grpczap/zapctx"
	"github.com/kazegusuri/grpczap"
	"golang.org/x/net/context"
)

func main() {
	logger = zap.NewJSON()
	uIntOpt := grpc.UnaryInterceptor(grpczap.UnaryZapHandler(logger))
	grpc.NewServer(uIntOpt)
}

func Foo(ctx context.Context) {
	logger := zapctx.MustFromContext(ctx)
	logger.Info("message")
}
AuthorMasahiro Sano
CopyrightCopyright (c) 2016- Masahiro Sano
LicenseMIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnaryZapHandler

func UnaryZapHandler(logger zap.Logger) grpc.UnaryServerInterceptor

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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