MCPcopy
hub / github.com/firerpa/lamda / intercept

Method intercept

lamda/client.py:431–441  ·  view source on GitHub ↗

Log API calls and arguments.

(self, function, request, details)

Source from the content-addressed store, hash-verified

429 def truncate_string(self, s):
430 return "{:.1024}...".format(s) if len(s) > 1024 else s
431 def intercept(self, function, request, details):
432 """
433 Log API calls and arguments.
434 """
435 displayable = isinstance(request, Message)
436 args = MessageToDict(request) if displayable else "-"
437 args = json.dumps(args, ensure_ascii=False, separators=(",", ":"))
438 args = self.truncate_string(args)
439 logger.debug("rpc {} {}".format(details.method, args))
440 res = function(request, details)
441 return res
442
443
444class ClientSessionMetadataInterceptor(ClientInterceptor):

Callers

nothing calls this directly

Calls 2

truncate_stringMethod · 0.95
formatMethod · 0.80

Tested by

no test coverage detected