Documentation

Overview

Package zapgrpc provides a logger that is compatible with grpclog.

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
}

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

func NewLogger

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

NewLogger returns a new Logger.

func (*Logger) Error

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

Error implements grpclog.LoggerV2.

func (*Logger) Errorf

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

Errorf implements grpclog.LoggerV2.

func (*Logger) Errorln

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

Errorln implements grpclog.LoggerV2.

func (*Logger) Fatal

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

Fatal implements grpclog.LoggerV2.

func (*Logger) Fatalf

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

Fatalf implements grpclog.LoggerV2.

func (*Logger) Fatalln

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

Fatalln implements grpclog.LoggerV2.

func (*Logger) Info

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

Info implements grpclog.LoggerV2.

func (*Logger) Infof

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

Infof implements grpclog.LoggerV2.

func (*Logger) Infoln

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

Infoln implements grpclog.LoggerV2.

func (*Logger) Print

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

Print implements grpclog.Logger. Deprecated: use Info().

func (*Logger) Printf

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

Printf implements grpclog.Logger. Deprecated: use Infof().

func (*Logger) Println

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

Println implements grpclog.Logger. Deprecated: use Info().

func (*Logger) V

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

V implements grpclog.LoggerV2.

func (*Logger) Warning

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

Warning implements grpclog.LoggerV2.

func (*Logger) Warningf

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

Warningf implements grpclog.LoggerV2.

func (*Logger) Warningln

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

Warningln implements grpclog.LoggerV2.

type Option

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

An Option overrides a Logger's default configuration.

func 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.

Source Files