Skip to content

Instantly share code, notes, and snippets.

@isaacl
Created February 27, 2014 06:14
Show Gist options
  • Save isaacl/9245292 to your computer and use it in GitHub Desktop.
Save isaacl/9245292 to your computer and use it in GitHub Desktop.
rpc logging in dev_appserver
diff --git a/google/appengine/api/apiproxy_rpc.py b/google/appengine/api/apiproxy_rpc.py
index 7e73bfd..b39c490 100644
--- a/google/appengine/api/apiproxy_rpc.py
+++ b/google/appengine/api/apiproxy_rpc.py
@@ -112,6 +112,18 @@ class RPC(object):
assert self.__state is RPC.IDLE, ('RPC for %s.%s has already been started' %
(self.package, self.call))
assert self.callback is None or callable(self.callback)
+ call = self.callback
+ def c2(*args, **kwargs):
+ out = None
+ try:
+ if call:
+ out = call(*args, **kwargs)
+ finally:
+ response = len(self.response.result_) if self.response else 0
+ import logging, pprint
+ logging.error('CALLBACK: call %r, request %s, responses %s', self.call, pprint.pformat(vars(self.request)), response)
+ return out
+ self.callback = c2
self._MakeCallImpl()
def Wait(self):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment