@Override
    public boolean saveLog(String name) {
        // stringefy dataLog and save to file in readable
        // xml format

        String dump = "";
        String ret = "\n";

        dump += dataLog.size() + ret;
        Iterator<DataItem> it=dataLog.iterator();

        while(it.hasNext()){
            DataItem i = it.next();
            dump += i.dataName + ret;
            dump += i.dataType + ret;
            dump += i.receivedTime + ret;
            dump += i.key + ret;
            dump += i.sender + ret;
            dump += i.dataPayload + ret;
        }

        PrintWriter writer = null;
        try {
            writer = new PrintWriter(name, "UTF-8");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        writer.println(dump);
        writer.close();
        return false;
    }