Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogRequest = grpc.UnaryServerInterceptor(func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { log := ctrl.LoggerFrom(ctx) log.V(1).Info("Request") resp, err = handler(ctx, req) if err != nil { if code := status.Code(err); code == codes.Unknown { log.Error(err, "Unknown error handling request") } } return resp, err })
LogRequest logs grpc requests. In case any request returns with status.Code == codes.Unknown, the error is logged.
Functions ¶
func InjectLogger ¶
func InjectLogger(log logr.Logger) grpc.UnaryServerInterceptor
InjectLogger injects the given logr.Logger into the context using ctrl.LoggerInto.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.