'@return: array of bytes'

def parseLog(self, stream):

    self.msgBuffer += stream
    buffLen = len(self.msgBuffer)
    pos = 0
    result = []
    while (buffLen >= (pos + 4)):
        (cmdID, dataLen) = struct.unpack('=HH', self.msgBuffer[pos:(pos + 4)])
        pos += 4
        if (buffLen < (pos + dataLen)):
            self.msgBuffer = self.msgBuffer[(pos - 4):]
            return result
        if (cmdID != CONSOLE_LOG_MSGID):
            print ('Unknown    command.(id    =    %s)' % cmdID)
            pos += dataLen
            continue
        result.append(self.msgBuffer[pos:(pos + dataLen)])
        pos += dataLen
    return result
