Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

zapgrpc

v1.28.0
go.uber.org/zap/zapgrpc

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

21 matches

Top ↑

Package zapgrpc provides a logger that is compatible with grpclog.

Types

Logger

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

Logger adapts zap's Logger to be compatible with grpclog.LoggerV2 and the deprecated grpclog.Logger.

NewLogger

func NewLogger(l *zap.Logger, options ...Option) *Logger

NewLogger returns a new Logger.

Logger.Error

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

Error implements grpclog.LoggerV2.

Logger.Errorf

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

Errorf implements grpclog.LoggerV2.

Logger.Errorln

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

Errorln implements grpclog.LoggerV2.

Logger.Fatal

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

Fatal implements grpclog.LoggerV2.

Logger.Fatalf

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

Fatalf implements grpclog.LoggerV2.

Logger.Fatalln

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

Fatalln implements grpclog.LoggerV2.

Logger.Info

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

Info implements grpclog.LoggerV2.

Logger.Infof

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

Infof implements grpclog.LoggerV2.

Logger.Infoln

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

Infoln implements grpclog.LoggerV2.

Logger.Print

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

Print implements grpclog.Logger.

Deprecated: use Logger.Info.

Logger.Printf

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

Printf implements grpclog.Logger.

Deprecated: use Logger.Infof.

Logger.Println

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

Println implements grpclog.Logger.

Deprecated: use Logger.Info.

Logger.V

func (l *Logger) V(level int) bool

V implements grpclog.LoggerV2.

Logger.Warning

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

Warning implements grpclog.LoggerV2.

Logger.Warningf

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

Warningf implements grpclog.LoggerV2.

Logger.Warningln

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

Warningln implements grpclog.LoggerV2.

Option

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

An Option overrides a Logger's default configuration.

WithDebug

func WithDebug() Option

WithDebug configures a Logger to print at zap's DebugLevel instead of InfoLevel. It only affects the Printf, Println and Print methods, which are only used in the gRPC v1 grpclog.Logger API.

Deprecated: use grpclog.SetLoggerV2() for v2 API.

Dependency graph