internal
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package internal contains functionality internal to the grpclog package.
Index¶
- type DepthLoggerV2
- type Loggerdeprecated
- type LoggerV2
- type LoggerV2Config
- type LoggerWrapper
- func (l *LoggerWrapper) Error(args ...any)
- func (l *LoggerWrapper) Errorf(format string, args ...any)
- func (l *LoggerWrapper) Errorln(args ...any)
- func (l *LoggerWrapper) Info(args ...any)
- func (l *LoggerWrapper) Infof(format string, args ...any)
- func (l *LoggerWrapper) Infoln(args ...any)
- func (*LoggerWrapper) V(int) bool
- func (l *LoggerWrapper) Warning(args ...any)
- func (l *LoggerWrapper) Warningf(format string, args ...any)
- func (l *LoggerWrapper) Warningln(args ...any)
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 DepthLoggerV2ImplDepthLoggerV2DepthLoggerV2Impl is the logger used for the depth log functions.
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 LoggerV2ImplLoggerV2LoggerV2Impl 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¶
func (*LoggerWrapper) V(int)bool
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.