Involved Source Filescomponent.go
Package grpclog defines logging for grpc.
All logs in transport and grpclb packages only go to verbose level 2.
All logs in other packages in grpc are logged in spite of the verbosity level.
In the default logger,
severity level can be set by environment variable GRPC_GO_LOG_SEVERITY_LEVEL,
verbosity level can be set by GRPC_GO_LOG_VERBOSITY_LEVEL.
logger.gologgerv2.go
Package-Level Type Names (total 7, in which 3 are exported)
/* sort exporteds by: | */
DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements
DepthLoggerV2, the below functions will be called with the appropriate stack
depth set for trivial functions the logger may ignore.
# Experimental
Notice: This type is EXPERIMENTAL and may be changed or removed in a
later release.
Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
ErrorDepth logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Println.
Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.
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.
FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println.
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.
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.
Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println.
Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.
V reports whether verbosity level l is at least the requested verbose level.
Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.
WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println.
Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.
*componentData
DepthLoggerV2 : LoggerV2
DepthLoggerV2 : google.golang.org/grpc/internal/grpclog.DepthLoggerV2
DepthLoggerV2 : google.golang.org/grpc/internal/grpclog.LoggerV2
DepthLoggerV2 : github.com/golang/mock/gomock.TestReporter
DepthLoggerV2 : go.uber.org/goleak.TestingT
func Component(componentName string) DepthLoggerV2
func google.golang.org/grpc/internal/channelz.AddTraceEvent(l DepthLoggerV2, id *channelz.Identifier, depth int, desc *channelz.TraceEventDesc)
func google.golang.org/grpc/internal/channelz.Error(l DepthLoggerV2, id *channelz.Identifier, args ...interface{})
func google.golang.org/grpc/internal/channelz.Errorf(l DepthLoggerV2, id *channelz.Identifier, format string, args ...interface{})
func google.golang.org/grpc/internal/channelz.Info(l DepthLoggerV2, id *channelz.Identifier, args ...interface{})
func google.golang.org/grpc/internal/channelz.Infof(l DepthLoggerV2, id *channelz.Identifier, format string, args ...interface{})
func google.golang.org/grpc/internal/channelz.Warning(l DepthLoggerV2, id *channelz.Identifier, args ...interface{})
func google.golang.org/grpc/internal/channelz.Warningf(l DepthLoggerV2, id *channelz.Identifier, format string, args ...interface{})
var google.golang.org/grpc.logger
var google.golang.org/grpc/balancer/base.logger
var google.golang.org/grpc/balancer/roundrobin.logger
var google.golang.org/grpc/connectivity.logger
var google.golang.org/grpc/internal/binarylog.grpclogLogger
var google.golang.org/grpc/internal/channelz.logger
var google.golang.org/grpc/internal/credentials.logger
var google.golang.org/grpc/internal/resolver/dns.logger
var google.golang.org/grpc/internal/serviceconfig.logger
var google.golang.org/grpc/internal/syscall.logger
var google.golang.org/grpc/internal/transport.logger
Logger mimics golang's standard Logger as an interface.
Deprecated: use LoggerV2.
( Logger) Fatal(args ...interface{})( Logger) Fatalf(format string, args ...interface{})( Logger) Fatalln(args ...interface{})( Logger) Print(args ...interface{})( Logger) Printf(format string, args ...interface{})( Logger) Println(args ...interface{})
*log.LoggerloggerWrapper
func SetLogger(l Logger)
LoggerV2 does underlying logging work for grpclog.
Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.
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.
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.
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.
Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.
V reports whether verbosity level l is at least the requested verbose level.
Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.
Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.
DepthLoggerV2(interface)
google.golang.org/grpc/internal/grpclog.LoggerV2(interface)
*componentData
*loggerT
*loggerWrapper
LoggerV2 : google.golang.org/grpc/internal/grpclog.LoggerV2
LoggerV2 : github.com/golang/mock/gomock.TestReporter
LoggerV2 : go.uber.org/goleak.TestingT
func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2
func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2
func newLoggerV2() LoggerV2
func newLoggerV2WithConfig(infoW, warningW, errorW io.Writer, c loggerV2Config) LoggerV2
func SetLoggerV2(l LoggerV2)
Package-Level Functions (total 24, in which 21 are exported)
Component creates a new component and returns it for logging. If a component
with the name already exists, nothing will be created and it will be
returned. SetLoggerV2 will panic if it is called with a logger created by
Component.
Error logs to the ERROR log.
Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf.
Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println.
Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print.
It calls os.Exit() with exit code 1.
Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf.
It calls os.Exit() with exit code 1.
Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println.
It calle os.Exit()) with exit code 1.
Info logs to the INFO log.
Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf.
Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println.
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.
NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and
verbosity level.
Print prints to the logger. Arguments are handled in the manner of fmt.Print.
Deprecated: use Info.
Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.
Deprecated: use Infof.
Println prints to the logger. Arguments are handled in the manner of fmt.Println.
Deprecated: use Infoln.
SetLogger sets the logger that is used in grpc. Call only from
init() functions.
Deprecated: use SetLoggerV2.
SetLoggerV2 sets logger that is used in grpc to a V2 logger.
Not mutex-protected, should be called before any gRPC functions.
V reports whether verbosity level l is at least the requested verbose level.
Warning logs to the WARNING log.
Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf.
Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println.