Version: v1.12.1 Latest Latest

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 1 Imported by: 0



Package zapgrpc provides a logger that is compatible with grpclog.



This section is empty.


This section is empty.


This section is empty.


type Logger

type Logger struct {
	// contains filtered or unexported fields

Logger adapts zap's Logger to be compatible with grpclog.Logger.

func NewLogger

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

NewLogger returns a new Logger.

By default, Loggers print at zap's InfoLevel.

func (*Logger) Fatal

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

Fatal implements grpclog.Logger.

func (*Logger) Fatalf

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

Fatalf implements grpclog.Logger.

func (*Logger) Fatalln

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

Fatalln implements grpclog.Logger.

func (*Logger) Print

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

Print implements grpclog.Logger.

func (*Logger) Printf

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

Printf implements grpclog.Logger.

func (*Logger) Println

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

Println implements grpclog.Logger.

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL