logger

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(ctx context.Context) *zap.Logger

FromContext pulls the logger off the context or returns the default.

func MustGetLogger

func MustGetLogger(cfg *Config) *zap.Logger

MustGetLogger uses the provided configuration to construct a logger. If an error occurs, it panics.

func StreamServerInterceptor

func StreamServerInterceptor(log *zap.Logger) grpc.StreamServerInterceptor

StreamServerInterceptor attaches a logger to the context.

func ToContext

func ToContext(ctx context.Context, logger *zap.Logger) context.Context

PutContext puts the logger on the provided context.

func UnaryServerInterceptor

func UnaryServerInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor

UnaryServerInterceptor attaches a logger to the context.

Types

type Config

type Config struct {
	ZapConfig zap.Config
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration used to

func WithFlags

func WithFlags(cfg *Config) (*Config, []cli.Flag)

WithFlags configures flags for the provided configuration.

Jump to

Keyboard shortcuts

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