grpclogging

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

DefaultPayloadLevel is default level to use when logging payloads

Variables

This section is empty.

Functions

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

Types

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.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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