Add debug logging to `gitosis-serve`.

This commit is contained in:
Tommi Virtanen 2007-06-04 14:22:58 +03:00
parent 0dc22b3155
commit d531488d77

View file

@ -40,6 +40,7 @@ COMMANDS_WRITE = [
] ]
def main(): def main():
log = logging.getLogger('gitosis.serve.main')
os.umask(0022) os.umask(0022)
parser = getParser() parser = getParser()
@ -53,6 +54,10 @@ def main():
if cmd is None: if cmd is None:
die("Need SSH_ORIGINAL_COMMAND in environment.") die("Need SSH_ORIGINAL_COMMAND in environment.")
log.debug('Got command %(cmd)r' % dict(
cmd=cmd,
))
if '\n' in cmd: if '\n' in cmd:
die("Command may not contain newlines.") die("Command may not contain newlines.")
@ -95,6 +100,11 @@ def main():
# didn't have write access and tried to write # didn't have write access and tried to write
die("Write access denied.") die("Write access denied.")
log.debug('Serving %(command)r %(newpath)r' % dict(
command=command,
newpath=newpath,
))
# put the command back together with the new path # put the command back together with the new path
newcmd = "%(command)s '%(newpath)s'" % dict( newcmd = "%(command)s '%(newpath)s'" % dict(
command=command, command=command,