private void writeLogs(@NonNull final Geocache cache) throws IOException {
        final List<LogEntry> logs = cache.getLogs();
        if (logs.isEmpty()) {
            return;
        }
        gpx.startTag(NS_GROUNDSPEAK, "logs");

        for (final LogEntry log : logs) {
            gpx.startTag(NS_GROUNDSPEAK, "log");

            String logId = cache.getServiceSpecificLogId(log);
            //GC.Com-specifics
            final long gcLogId = GCUtils.logCodeToLogId(logId);
            if (gcLogId > 0) {
                logId = Long.toString(gcLogId);
            }
            //fall back to internal id if we have no service-specific id
            if (StringUtils.isBlank(logId)) {
                logId = Integer.toString(log.id);
            }

            gpx.attribute("", "id", logId);

            XmlUtils.multipleTexts(gpx, NS_GROUNDSPEAK, "date", dateFormatZ.format(new Date(log.date)), "type", log.logType.type);

            gpx.startTag(NS_GROUNDSPEAK, "finder");
            gpx.attribute("", "id", "");
            gpx.text(log.author);
            gpx.endTag(NS_GROUNDSPEAK, "finder");

            gpx.startTag(NS_GROUNDSPEAK, "text");
            gpx.attribute("", "encoded", "False");
            try {
                gpx.text(log.log);
            } catch (final IllegalArgumentException e) {
                Log.e("GpxSerializer.writeLogs: cannot write log " + log.id + " for cache " + cache.getGeocode(), e);
                gpx.text(" [end of log omitted due to an invalid character]");
            }
            gpx.endTag(NS_GROUNDSPEAK, "text");

            gpx.endTag(NS_GROUNDSPEAK, "log");
        }

        gpx.endTag(NS_GROUNDSPEAK, "logs");
    }
Writes one waypoint entry for cache waypoint.
main/src/main/java/cgeo/geocaching/export/GpxSerializer.java