Movatterモバイル変換


[0]ホーム

URL:


internal

package
v1.77.0Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:5Imported by:0

Details

Repository

github.com/grpc/grpc-go

Links

Documentation

Overview

Package internal contains functionality internal to the grpclog package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeDepthLoggerV2

type DepthLoggerV2 interface {LoggerV2// InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println.InfoDepth(depthint, args ...any)// WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println.WarningDepth(depthint, args ...any)// ErrorDepth logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Println.ErrorDepth(depthint, args ...any)// FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println.FatalDepth(depthint, args ...any)}

DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implementsDepthLoggerV2, the below functions will be called with the appropriate stackdepth set for trivial functions the logger may ignore.

Experimental

Notice: This type is EXPERIMENTAL and may be changed or removed in alater release.

var DepthLoggerV2ImplDepthLoggerV2

DepthLoggerV2Impl is the logger used for the depth log functions.

typeLoggerdeprecated

type Logger interface {Fatal(args ...any)Fatalf(formatstring, args ...any)Fatalln(args ...any)Print(args ...any)Printf(formatstring, args ...any)Println(args ...any)}

Logger mimics golang's standard Logger as an interface.

Deprecated: use LoggerV2.

typeLoggerV2

type LoggerV2 interface {// Info logs to INFO log. Arguments are handled in the manner of fmt.Print.Info(args ...any)// Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.Infoln(args ...any)// Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.Infof(formatstring, args ...any)// Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.Warning(args ...any)// Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.Warningln(args ...any)// Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.Warningf(formatstring, args ...any)// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.Error(args ...any)// Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.Errorln(args ...any)// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.Errorf(formatstring, args ...any)// Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.// gRPC ensures that all Fatal logs will exit with os.Exit(1).// Implementations may also call os.Exit() with a non-zero exit code.Fatal(args ...any)// Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println.// gRPC ensures that all Fatal logs will exit with os.Exit(1).// Implementations may also call os.Exit() with a non-zero exit code.Fatalln(args ...any)// Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.// gRPC ensures that all Fatal logs will exit with os.Exit(1).// Implementations may also call os.Exit() with a non-zero exit code.Fatalf(formatstring, args ...any)// V reports whether verbosity level l is at least the requested verbose level.V(lint)bool}

LoggerV2 does underlying logging work for grpclog.

var LoggerV2ImplLoggerV2

LoggerV2Impl is the logger used for the non-depth log functions.

funcNewLoggerV2

func NewLoggerV2(infoW, warningW, errorWio.Writer, cLoggerV2Config)LoggerV2

NewLoggerV2 creates a new LoggerV2 instance with the provided configuration.The infoW, warningW, and errorW writers are used to write log messages ofdifferent severity levels.

typeLoggerV2Config

type LoggerV2Config struct {// Verbosity sets the verbosity level of the logger.Verbosityint// FormatJSON controls whether the logger should output logs in JSON format.FormatJSONbool}

LoggerV2Config configures the LoggerV2 implementation.

typeLoggerWrapper

type LoggerWrapper struct {Logger}

LoggerWrapper wraps Logger into a LoggerV2.

func (*LoggerWrapper)Error

func (l *LoggerWrapper) Error(args ...any)

Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.

func (*LoggerWrapper)Errorf

func (l *LoggerWrapper) Errorf(formatstring, args ...any)

Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.

func (*LoggerWrapper)Errorln

func (l *LoggerWrapper) Errorln(args ...any)

Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.

func (*LoggerWrapper)Info

func (l *LoggerWrapper) Info(args ...any)

Info logs to INFO log. Arguments are handled in the manner of fmt.Print.

func (*LoggerWrapper)Infof

func (l *LoggerWrapper) Infof(formatstring, args ...any)

Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.

func (*LoggerWrapper)Infoln

func (l *LoggerWrapper) Infoln(args ...any)

Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.

func (*LoggerWrapper)V

V reports whether verbosity level l is at least the requested verbose level.

func (*LoggerWrapper)Warning

func (l *LoggerWrapper) Warning(args ...any)

Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.

func (*LoggerWrapper)Warningf

func (l *LoggerWrapper) Warningf(formatstring, args ...any)

Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.

func (*LoggerWrapper)Warningln

func (l *LoggerWrapper) Warningln(args ...any)

Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp