grpclog
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 grpclog defines logging for grpc.
In the default logger, severity level can be set by environment variableGRPC_GO_LOG_SEVERITY_LEVEL, verbosity level can be set byGRPC_GO_LOG_VERBOSITY_LEVEL.
Index¶
- func Error(args ...any)
- func ErrorDepth(depth int, args ...any)
- func Errorf(format string, args ...any)
- func Errorln(args ...any)
- func Fatal(args ...any)
- func FatalDepth(depth int, args ...any)
- func Fatalf(format string, args ...any)
- func Fatalln(args ...any)
- func Info(args ...any)
- func InfoDepth(depth int, args ...any)
- func Infof(format string, args ...any)
- func Infoln(args ...any)
- func Print(args ...any)deprecated
- func Printf(format string, args ...any)deprecated
- func Println(args ...any)deprecated
- func SetLogger(l Logger)deprecated
- func SetLoggerV2(l LoggerV2)
- func V(l int) bool
- func Warning(args ...any)
- func WarningDepth(depth int, args ...any)
- func Warningf(format string, args ...any)
- func Warningln(args ...any)
- type DepthLoggerV2
- type Loggerdeprecated
- type LoggerV2
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcErrorDepth¶added inv1.66.0
ErrorDepth logs to the ERROR log at the specified depth.
Experimental¶
Notice: This API is EXPERIMENTAL and may be changed or removed in alater release.
funcErrorf¶added inv1.5.0
Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf.
funcErrorln¶added inv1.5.0
func Errorln(args ...any)
Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println.
funcFatal¶
func Fatal(args ...any)
Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print.It calls os.Exit() with exit code 1.
funcFatalDepth¶added inv1.66.0
FatalDepth logs to the FATAL log at the specified depth.
Experimental¶
Notice: This API is EXPERIMENTAL and may be changed or removed in alater release.
funcFatalf¶
Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf.It calls os.Exit() with exit code 1.
funcFatalln¶
func Fatalln(args ...any)
Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println.It calls os.Exit() with exit code 1.
funcInfoDepth¶added inv1.66.0
InfoDepth logs to the INFO log at the specified depth.
Experimental¶
Notice: This API is EXPERIMENTAL and may be changed or removed in alater release.
funcInfof¶added inv1.5.0
Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf.
funcInfoln¶added inv1.5.0
func Infoln(args ...any)
Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println.
funcSetLoggerV2¶added inv1.5.0
func SetLoggerV2(lLoggerV2)
SetLoggerV2 sets logger that is used in grpc to a V2 logger.Not mutex-protected, should be called before any gRPC functions.
funcWarningDepth¶added inv1.66.0
WarningDepth logs to the WARNING log at the specified depth.
Experimental¶
Notice: This API is EXPERIMENTAL and may be changed or removed in alater release.
Types¶
typeDepthLoggerV2¶added inv1.28.0
type DepthLoggerV2internal.DepthLoggerV2
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.
funcComponent¶added inv1.31.0
func Component(componentNamestring)DepthLoggerV2
Component creates a new component and returns it for logging. If a componentwith the name already exists, nothing will be created and it will bereturned. SetLoggerV2 will panic if it is called with a logger created byComponent.
typeLoggerV2¶added inv1.5.0
LoggerV2 does underlying logging work for grpclog.
funcNewLoggerV2¶added inv1.5.0
NewLoggerV2 creates a loggerV2 with the provided writers.Fatal logs will be written to errorW, warningW, infoW, followed by exit(1).Error logs will be written to errorW, warningW and infoW.Warning logs will be written to warningW and infoW.Info logs will be written to infoW.