Back to / zapgrpc

Package zapgrpc

Latest Go to latest

The latest major version is .

Published: Sep 1, 2020 | License: MIT | Module:


Package zapgrpc provides a logger that is compatible with grpclog.


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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier