...

Package grpclogging

import "github.com/hyperledger/fabric/common/grpclogging"
Overview
Index
Subdirectories

Overview ▾

Constants

DefaultPayloadLevel is default level to use when logging payloads

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

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

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

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

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

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

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

Subdirectories

Name Synopsis
..
fakes Code generated by counterfeiter.
testpb