pm_zap

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMessageProducer

func DefaultMessageProducer(ctx context.Context, msg string, err error, duration time.Duration)

DefaultMessageProducer writes the default message

func SubscriptionInterceptor

func SubscriptionInterceptor(logger *zap.Logger, opt ...Option) pm.SubscriptionInterceptor

SubscriptionInterceptor returns a subscription interceptor that optionally logs the subscription process.

Types

type MessageProducer

type MessageProducer func(ctx context.Context, msg string, err error, duration time.Duration)

MessageProducer produces a user defined log message

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is a option to change configuration.

func WithLogDecider

func WithLogDecider(f pm_logging.LogDecider) Option

WithLogDecider customizes the function for deciding if the pm interceptor should log.

func WithMessageProducer

func WithMessageProducer(f MessageProducer) Option

WithMessageProducer customizes the function for logging.

type OptionFunc

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

Jump to

Keyboard shortcuts

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