MCPcopy Index your code
hub / github.com/PasarGuard/node / LoggingInterceptor

Function LoggingInterceptor

controller/rpc/middleware.go:137–157  ·  view source on GitHub ↗
(s *Service)

Source from the content-addressed store, hash-verified

135}
136
137func LoggingInterceptor(s *Service) grpc.UnaryServerInterceptor {
138 return func(
139 ctx context.Context,
140 req interface{},
141 info *grpc.UnaryServerInfo,
142 handler grpc.UnaryHandler,
143 ) (interface{}, error) {
144 // Handle the request
145 resp, err := handler(ctx, req)
146
147 // Log the request
148 logRequest(ctx, info.FullMethod, err)
149
150 // Track successful requests
151 if err == nil {
152 s.NewRequest()
153 }
154
155 return resp, err
156 }
157}
158
159func LoggingStreamInterceptor(s *Service) grpc.StreamServerInterceptor {
160 return func(

Callers 1

ConditionalMiddlewareFunction · 0.85

Calls 2

logRequestFunction · 0.85
NewRequestMethod · 0.80

Tested by

no test coverage detected