# HG changeset patch # User Marcin Kuzminski # Date 1348842392 -7200 # Node ID f68522e3df7970bbc427dda47a079e2b3fd325b2 # Parent 95923493de9adfd862c416fec65c7aa58f52d948 more logging in pygrack diff -r 95923493de9a -r f68522e3df79 rhodecode/lib/middleware/pygrack.py --- a/rhodecode/lib/middleware/pygrack.py Fri Sep 28 15:57:57 2012 +0200 +++ b/rhodecode/lib/middleware/pygrack.py Fri Sep 28 16:26:32 2012 +0200 @@ -2,6 +2,7 @@ import socket import logging import subprocess +import traceback from webob import Request, Response, exc @@ -90,7 +91,7 @@ ] ) except EnvironmentError, e: - log.exception(e) + log.error(traceback.format_exc()) raise exc.HTTPExpectationFailed() resp = Response() resp.content_type = 'application/x-%s-advertisement' % str(git_command) @@ -126,23 +127,25 @@ env=gitenv, cwd=os.getcwd() ) - + cmd = r'git %s --stateless-rpc "%s"' % (git_command[4:], + self.content_path), + log.debug('handling cmd %s' % cmd) out = subprocessio.SubprocessIOChunker( - r'git %s --stateless-rpc "%s"' % (git_command[4:], - self.content_path), + cmd, inputstream=inputstream, **opts ) except EnvironmentError, e: - log.exception(e) + log.error(traceback.format_exc()) raise exc.HTTPExpectationFailed() if git_command in [u'git-receive-pack']: # updating refs manually after each push. # Needed for pre-1.7.0.4 git clients using regular HTTP mode. - subprocess.call(u'git --git-dir "%s" ' - 'update-server-info' % self.content_path, - shell=True) + cmd = (u'git --git-dir "%s" ' + 'update-server-info' % self.content_path) + log.debug('handling cmd %s' % cmd) + subprocess.call(cmd, shell=True) resp = Response() resp.content_type = 'application/x-%s-result' % git_command.encode('utf8') @@ -161,9 +164,9 @@ resp = app(request, environ) except exc.HTTPException, e: resp = e - log.exception(e) + log.error(traceback.format_exc()) except Exception, e: - log.exception(e) + log.error(traceback.format_exc()) resp = exc.HTTPInternalServerError() return resp(environ, start_response)