ni_grpc_extensions.loggers
gRPC logging interceptors.
Classes
Intercepts gRPC client calls and logs them for debugging. |
|
Intercepts gRPC server calls and logs them for debugging. |
Module Contents
- class ni_grpc_extensions.loggers.ClientLogger[source]
Bases:
grpc.UnaryUnaryClientInterceptor,grpc.UnaryStreamClientInterceptor,grpc.StreamUnaryClientInterceptor,grpc.StreamStreamClientInterceptorIntercepts gRPC client calls and logs them for debugging.
- classmethod is_enabled()[source]
Indicates whether gRPC client call logging is enabled for the current log level.
- Return type:
- intercept_unary_unary(continuation, client_call_details, request)[source]
Intercept and log a unary call.
- Parameters:
continuation (Callable[[grpc.ClientCallDetails, grpc._TRequest], grpc._CallFuture[grpc._TResponse]])
client_call_details (grpc.ClientCallDetails)
request (grpc._TRequest)
- Return type:
grpc._CallFuture[grpc._TResponse]
- intercept_unary_stream(continuation, client_call_details, request)[source]
Intercept and log a server-streaming call.
- Parameters:
continuation (Callable[[grpc.ClientCallDetails, grpc._TRequest], grpc._CallIterator[grpc._TResponse]])
client_call_details (grpc.ClientCallDetails)
request (grpc._TRequest)
- Return type:
grpc._CallIterator[grpc._TResponse]
- intercept_stream_unary(continuation, client_call_details, request_iterator)[source]
Intercept and log a client-streaming call.
- Parameters:
continuation (Callable[[grpc.ClientCallDetails, collections.abc.Iterator[grpc._TRequest]], grpc._CallFuture[grpc._TResponse]])
client_call_details (grpc.ClientCallDetails)
request_iterator (collections.abc.Iterator[grpc._TRequest])
- Return type:
grpc._CallFuture[grpc._TResponse]
- intercept_stream_stream(continuation, client_call_details, request_iterator)[source]
Intercept and log a bidirectional streaming call.
- Parameters:
continuation (Callable[[grpc.ClientCallDetails, collections.abc.Iterator[grpc._TRequest]], grpc._CallIterator[grpc._TResponse]])
client_call_details (grpc.ClientCallDetails)
request_iterator (collections.abc.Iterator[grpc._TRequest])
- Return type:
grpc._CallIterator[grpc._TResponse]
- class ni_grpc_extensions.loggers.ServerLogger[source]
Bases:
grpc.ServerInterceptorIntercepts gRPC server calls and logs them for debugging.
- classmethod is_enabled()[source]
Indicates whether gRPC client call logging is enabled for the current log level.
- Return type:
- intercept_service(continuation, handler_call_details)[source]
Intercept and log a server call.
- Parameters:
continuation (Callable[[grpc.HandlerCallDetails], grpc.RpcMethodHandler[grpc._TRequest, grpc._TResponse] | None])
handler_call_details (grpc.HandlerCallDetails)
- Return type:
grpc.RpcMethodHandler[grpc._TRequest, grpc._TResponse] | None