Class: GrpcInterceptors::Server::LoggingInterceptor

Inherits:
GRPC::ServerInterceptor
  • Object
show all
Defined in:
lib/grpc_interceptors/server/logging_interceptor.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ LoggingInterceptor

Returns a new instance of LoggingInterceptor.



10
11
12
13
14
# File 'lib/grpc_interceptors/server/logging_interceptor.rb', line 10

def initialize(logger)
  @logger = logger

  super()
end

Instance Method Details

#request_response(request: nil, call: nil, method: nil, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/grpc_interceptors/server/logging_interceptor.rb', line 16

def request_response(request: nil, call: nil, method: nil, &block)
  Common::Logging.yield_and_log(
    logger: @logger, request: request, method: method,
    method_type: 'unary', kind: GrpcInterceptors::Server::KIND, &block
  )
end