zapgrpc

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 3 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.LoggerV2 and the deprecated grpclog.Logger.

func NewLogger

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

NewLogger returns a new Logger.

func (*Logger) Error added in v1.17.0

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

Error implements grpclog.LoggerV2.

func (*Logger) Errorf added in v1.17.0

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

Errorf implements grpclog.LoggerV2.

func (*Logger) Errorln added in v1.17.0

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 added in v1.17.0

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

Info implements grpclog.LoggerV2.

func (*Logger) Infof added in v1.17.0

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

Infof implements grpclog.LoggerV2.

func (*Logger) Infoln added in v1.17.0

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

Infoln implements grpclog.LoggerV2.

func (*Logger) Print deprecated

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

Print implements grpclog.Logger.

Deprecated: use Logger.Info.

func (*Logger) Printf deprecated

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

Printf implements grpclog.Logger.

Deprecated: use Logger.Infof.

func (*Logger) Println deprecated

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

Println implements grpclog.Logger.

Deprecated: use Logger.Info.

func (*Logger) V added in v1.17.0

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

V implements grpclog.LoggerV2.

func (*Logger) Warning added in v1.17.0

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

Warning implements grpclog.LoggerV2.

func (*Logger) Warningf added in v1.17.0

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

Warningf implements grpclog.LoggerV2.

func (*Logger) Warningln added in v1.17.0

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 deprecated

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.

Directories

Path Synopsis
internal
test Module

Jump to

Keyboard shortcuts

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