'åloggeråéäžæ¡æ¥å¿'

def sendLog(self, uid, type, logStr):

    if (type not in logName2type):
        print ("invalid    log    type    '%s'" % type)
        return
    if (not isinstance(logStr, bytes)):
        logStr = logStr.encode('utf-8')
    if (logStr[(-1)] != '\n'.encode()):
        logStr += '\n'.encode()
    logSize = len(logStr)
    msg = Define.BytesIO()
    msg.write(struct.pack('=H', Logger_writeLog))
    msg.write(struct.pack('=H', (struct.calcsize('=iIiQiiqII') + logSize)))
    msg.write(struct.pack('=i', uid))
    msg.write(struct.pack('=I', logName2type[type]))
    msg.write(struct.pack('=i', Define.WATCHER_TYPE))
    msg.write(struct.pack('=Qii', 0, 0, 0))
    msg.write(struct.pack('=qI', int(time.time()), 0))
    msg.write(struct.pack('=I', logSize))
    msg.write(logStr)
    self.socket.sendall(msg.getvalue())
