@NonNull
    private static String getCounter(final LogContext context, final boolean incrementCounter) {
        final Geocache cache = context.getCache();
        if (cache == null) {
            return StringUtils.EMPTY;
        }

        int current = 0;
        final IConnector connector = ConnectorFactory.getConnector(cache);
        if (connector instanceof ILogin) {
            current = ((ILogin) connector).getCachesFound();
        }

        // try updating the login information, if the counter is zero
        if (current == 0) {
            if (context.isOffline()) {
                return StringUtils.EMPTY;
            }
            if (connector instanceof ILogin) {
                ((ILogin) connector).login();
                current = ((ILogin) connector).getCachesFound();
            }
        }

        if (current >= 0) {
            return String.valueOf(incrementCounter ? current + 1 : current);
        }
        return StringUtils.EMPTY;
    }
@return all user-facing templates, but not the signature template itself
main/src/main/java/cgeo/geocaching/log/LogTemplateProvider.java