def log(self,proto,data):
        if not self.logging: return
        peer = self.transport.getPeer()
        their_peer = self.otherConn.transport.getPeer()
        f=open(self.logging,"a")
        f.write("%s\t%s:%d %s %s:%d\n"%(time.ctime(),
                                        peer.host,peer.port,
                                        ((proto==self and '<') or '>'),
                                        their_peer.host,their_peer.port))
        while data:
            p,data=data[:16],data[16:]
            f.write(string.join(map(lambda x:'%02X'%ord(x),p),' ')+' ')
            f.write((16-len(p))*3*' ')
            for c in p:
                if 3 > len(repr(c)): f.write('.')
                else: f.write(c)
            f.write('\n')
        f.write('\n')
        f.close()
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/protocols/socks.py/SOCKSv4.log/swapped operands of `>`