Back to godoc.org

Package grpclogging

v1.4.7
Latest Go to latest

The latest major version is .

Published: May 14, 2020 | License: Apache-2.0 | Module: gitee.com/peter_code_git/fabric

Index

Constants

const DefaultPayloadLevel = zapcore.Level(zapcore.DebugLevel - 1)

DefaultPayloadLevel is default level to use when logging payloads

func Error

func Error(err error) zapcore.Field

func Fields

func Fields(ctx context.Context) []interface{}

func ProtoMessage

func ProtoMessage(key string, val interface{}) zapcore.Field

func StreamServerInterceptor

func StreamServerInterceptor(logger *zap.Logger, opts ...Option) grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(logger *zap.Logger, opts ...Option) grpc.UnaryServerInterceptor

func WithFields

func WithFields(ctx context.Context, fields []zapcore.Field) context.Context

func ZapFields

func ZapFields(ctx context.Context) []zapcore.Field

type Leveler

type Leveler interface {
	Level(ctx context.Context, fullMethod string) zapcore.Level
}

Leveler returns a zap level to use when logging from a grpc interceptor.

type LevelerFunc

type LevelerFunc func(ctx context.Context, fullMethod string) zapcore.Level

func (LevelerFunc) Level

func (l LevelerFunc) Level(ctx context.Context, fullMethod string) zapcore.Level

func (LevelerFunc) PayloadLevel

func (l LevelerFunc) PayloadLevel(ctx context.Context, fullMethod string) zapcore.Level

type Option

type Option func(o *options)

func WithLeveler

func WithLeveler(l Leveler) Option

func WithPayloadLeveler

func WithPayloadLeveler(l PayloadLeveler) Option

type PayloadLeveler

type PayloadLeveler interface {
	PayloadLevel(ctx context.Context, fullMethod string) zapcore.Level
}

PayloadLeveler gets the level to use when logging grpc message payloads.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier