grpclogging

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

DefaultPayloadLevel是记录有效负载时使用的默认级别

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返回从GRPC拦截器进行日志记录时要使用的ZAP级别。

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获取在记录GRPC消息有效负载时要使用的级别。

Directories

Path Synopsis
伪造者生成的代码。
伪造者生成的代码。

Jump to

Keyboard shortcuts

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