@NonNull
    public static List<LogEntry> loadLogs(final String geocode) {
        return withAccessLock(() -> {

            try (ContextLogger cLog = new ContextLogger("DataStore.loadLogs(%s)", geocode)) {
                final List<LogEntry> logs = new ArrayList<>();

                if (StringUtils.isBlank(geocode)) {
                    return logs;
                }

                init();

                final Cursor cursor = database.rawQuery(
                        //                     0           1               2     3       4            5    6     7      8                                       9                10      11     12   13           14
                        "SELECT cg_logs._id AS cg_logs_id, service_log_id, type, author, author_guid, log, date, found, friend, " + dbTableLogImages + "._id as cg_logImages_id, log_id, title, url, description, service_image_id"
                                + " FROM " + dbTableLogs + " LEFT OUTER JOIN " + dbTableLogImages
                                + " ON ( cg_logs._id = log_id ) WHERE geocode = ?  ORDER BY date DESC, cg_logs._id ASC", new String[]{geocode});

                LogEntry.Builder log = null;
                int cnt = 0;
                while (cursor.moveToNext() && logs.size() < 100) {
                    cnt++;
                    if (log == null || log.getId() != cursor.getInt(0)) {
                        // Start of a new log entry group (we may have several entries if the log has several images).
                        if (log != null) {
                            logs.add(log.build());
                        }
                        log = new LogEntry.Builder()
                                .setId(cursor.getInt(0))
                                .setServiceLogId(cursor.getString(1))
                                .setLogType(LogType.getById(cursor.getInt(2)))
                                .setAuthor(cursor.getString(3))
                                .setAuthorGuid(cursor.getString(4))
                                .setLog(cursor.getString(5))
                                .setDate(cursor.getLong(6))
                                .setFound(cursor.getInt(7))
                                .setFriend(cursor.getInt(8) == 1);
                        if (!cursor.isNull(9)) {
                            log.addLogImage(new Image.Builder().setUrl(cursor.getString(12)).setTitle(cursor.getString(11)).setDescription(cursor.getString(13)).setServiceImageId(cursor.getString(14)).build());
                        }
                    } else {
                        // We cannot get several lines for the same log entry if it does not contain an image.
                        log.addLogImage(new Image.Builder().setUrl(cursor.getString(12)).setTitle(cursor.getString(11)).setDescription(cursor.getString(13)).setServiceImageId(cursor.getString(14)).build());
                    }
                }
                if (log != null) {
                    logs.add(log.build());
                }

                cursor.close();

                cLog.add("l:%d,#:%d", cnt, logs.size());

                return Collections.unmodifiableList(logs);
            }
        });
    }
@return an immutable, non null list of logs
main/src/main/java/cgeo/geocaching/storage/DataStore.java