logging

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSkipper = Skipper(func(string, string, error) bool { return false })
)

Functions

This section is empty.

Types

type LoggingInterceptor

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

func New

func New(opts ...Option) *LoggingInterceptor

New will initlize the gRPC zap logger. If options aren't provided it will use the global logger for zap (`zap.L()`) and it won't skip anything.

func (*LoggingInterceptor) StreamClientInterceptor

func (z *LoggingInterceptor) StreamClientInterceptor() grpc.StreamClientInterceptor

func (*LoggingInterceptor) StreamServerInterceptor

func (z *LoggingInterceptor) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*LoggingInterceptor) UnaryClientInterceptor

func (z *LoggingInterceptor) UnaryClientInterceptor() grpc.UnaryClientInterceptor

func (*LoggingInterceptor) UnaryServerInterceptor

func (z *LoggingInterceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor

type Option

type Option func(*options)

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithSkipper

func WithSkipper(skipper Skipper) Option

type Skipper

type Skipper func(service, method string, err error) (skip bool)

Skipper defines the type for a callback function in which one should pass a condition where a log entry will get skipped.

Jump to

Keyboard shortcuts

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