zapgrpc

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 1 Imported by: 358

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

Directories

Path Synopsis
internal
test Module

Jump to

Keyboard shortcuts

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