src/mercurialserver/servelog.py
changeset 375 a41e4382ea6e
parent 373 a286d6c6b19c
equal deleted inserted replaced
373:a286d6c6b19c 375:a41e4382ea6e
    31     logentry.update(dict(
    31     logentry.update(dict(
    32         timestamp=time.strftime("%Y-%m-%d_%H:%M:%S Z", time.gmtime()),
    32         timestamp=time.strftime("%Y-%m-%d_%H:%M:%S Z", time.gmtime()),
    33         op=op,
    33         op=op,
    34         key=ruleset.rules.get('user'),
    34         key=ruleset.rules.get('user'),
    35         ssh_connection=os.environ['SSH_CONNECTION'],))
    35         ssh_connection=os.environ['SSH_CONNECTION'],))
    36     with open(repo.join("mercurial-server.log"), "a+") as log:
    36     with open(repo.vfs.join("mercurial-server.log"), "a+") as log:
    37         fcntl.flock(log.fileno(), fcntl.LOCK_EX)
    37         fcntl.flock(log.fileno(), fcntl.LOCK_EX)
    38         log.seek(0, os.SEEK_END)
    38         log.seek(0, os.SEEK_END)
    39         # YAML log file format
    39         # YAML log file format
    40         log.write("- %s\n" % json.dumps(data))
    40         log.write("- %s\n" % json.dumps(data))
    41     
    41