grpclogger

package
v0.0.0-...-32e62f0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientInterceptor

func ClientInterceptor(loggerFactory LoggerFactory, opts ...Option) (grpc.UnaryClientInterceptor, grpc.StreamClientInterceptor)

func ServerInterceptor

func ServerInterceptor(loggerFactory LoggerFactory, opts ...Option) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)

func StreamClientInterceptor

func StreamClientInterceptor(loggerFactory LoggerFactory, opts ...Option) grpc.StreamClientInterceptor

func StreamServerInterceptor

func StreamServerInterceptor(loggerFactory LoggerFactory, opts ...Option) grpc.StreamServerInterceptor

func UnaryClientInterceptor

func UnaryClientInterceptor(loggerFactory LoggerFactory, opts ...Option) grpc.UnaryClientInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(loggerFactory LoggerFactory, opts ...Option) grpc.UnaryServerInterceptor

Types

type FieldBuilder

type FieldBuilder struct {
	// contains filtered or unexported fields
}

func NewFieldBuilder

func NewFieldBuilder() *FieldBuilder

func (*FieldBuilder) Build

func (f *FieldBuilder) Build() map[string]interface{}

func (*FieldBuilder) Client

func (f *FieldBuilder) Client() *FieldBuilder

func (*FieldBuilder) Deadline

func (f *FieldBuilder) Deadline(ctx context.Context) *FieldBuilder

func (*FieldBuilder) Error

func (f *FieldBuilder) Error(err error) *FieldBuilder

func (*FieldBuilder) Latency

func (f *FieldBuilder) Latency(duration time.Duration) *FieldBuilder

func (*FieldBuilder) MetaData

func (f *FieldBuilder) MetaData(md metadata.MD) *FieldBuilder

func (*FieldBuilder) Method

func (f *FieldBuilder) Method(method string) *FieldBuilder

func (*FieldBuilder) PeerAddr

func (f *FieldBuilder) PeerAddr(ctx context.Context) *FieldBuilder

func (*FieldBuilder) Server

func (f *FieldBuilder) Server() *FieldBuilder

func (*FieldBuilder) StartTime

func (f *FieldBuilder) StartTime(startTime time.Time) *FieldBuilder

func (*FieldBuilder) Status

func (f *FieldBuilder) Status(err error) *FieldBuilder

type Logger

type Logger interface {
	Log(fields map[string]interface{})
}

type LoggerFactory

type LoggerFactory func(ctx context.Context) Logger

type Option

type Option func(o *options)

func WithSkip

func WithSkip(skip func(fullMethodName string, err error) bool) Option

Jump to

Keyboard shortcuts

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