grpc

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 2 Imported by: 0

README

grpc-zerolog

grpc-zerolog is a simple implementation of grpclog.LoggerV2 interface using zerolog. Use this to log the internal actions of a gRPC server or client.

Usage

Add the following before you grpc.Dial either a client or server.

logger := zerolog.New(os.Stdout).With().Timestamp().Logger()
logger = logger.With().Str("module", "grpc").Logger()

grpclog.SetLoggerV2(grpc.New(logger))

Start your server/client with the following environment variable.

GRPC_GO_LOG_VERBOSITY_LEVEL=info GRPC_GO_LOG_VERBOSITY_LEVEL=99 go run cmd/account/main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func New

func New(log zerolog.Logger) Logger

func (Logger) Error

func (l Logger) Error(args ...interface{})

func (Logger) Errorf

func (l Logger) Errorf(format string, args ...interface{})

func (Logger) Errorln

func (l Logger) Errorln(args ...interface{})

func (Logger) Fatal

func (l Logger) Fatal(args ...interface{})

func (Logger) Fatalf

func (l Logger) Fatalf(format string, args ...interface{})

func (Logger) Fatalln

func (l Logger) Fatalln(args ...interface{})

func (Logger) Info

func (l Logger) Info(args ...interface{})

func (Logger) Infof

func (l Logger) Infof(format string, args ...interface{})

func (Logger) Infoln

func (l Logger) Infoln(args ...interface{})

func (Logger) Print

func (l Logger) Print(args ...interface{})

func (Logger) Printf

func (l Logger) Printf(format string, args ...interface{})

func (Logger) Println

func (l Logger) Println(args ...interface{})

func (Logger) V

func (l Logger) V(level int) bool

func (Logger) Warning

func (l Logger) Warning(args ...interface{})

func (Logger) Warningf

func (l Logger) Warningf(format string, args ...interface{})

func (Logger) Warningln

func (l Logger) Warningln(args ...interface{})

Jump to

Keyboard shortcuts

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