public static ImmutablePair<String, String> getMultiPurposeString(@StringRes final int messageId, final String fallback, final Object... params) {

        //prepare params message
        final Object[] paramsForLog = new Object[params.length];
        final Object[] paramsForUser = new Object[params.length];
        //Note that ContentStorage.get() can actually be null here in case there was an error in initialization of Log!
        for (int i = 0; i < params.length; i++) {
            paramsForUser[i] = null;
            paramsForLog[i] = null;
            try {
                if (params[i] instanceof Folder) {
                    paramsForUser[i] = ((Folder) params[i]).toUserDisplayableString();
                    paramsForLog[i] = params[i] + "(" + (ContentStorage.get() == null ? null : ContentStorage.get().getUriForFolder((Folder) params[i])) + ")";
                } else if (params[i] instanceof PersistableFolder) {
                    paramsForUser[i] = ((PersistableFolder) params[i]).toUserDisplayableValue();
                    paramsForLog[i] = params[i] + "(" + (ContentStorage.get() == null ? null : ContentStorage.get().getUriForFolder(((PersistableFolder) params[i]).getFolder())) + ")";
                } else if (params[i] instanceof Uri) {
                    paramsForUser[i] = UriUtils.toUserDisplayableString((Uri) params[i]);
                    paramsForLog[i] = params[i];
                }
            } catch (Exception ex) {
                //regardless of exceptions, getting multipurpose string must always work!
                Log.v("Exception creating multipurposestring", ex);
            }
            if (paramsForUser[i] == null) {
                paramsForUser[i] = params[i];
            }
            if (paramsForLog[i] == null) {
                paramsForLog[i] = params[i];
            }
        }
        return new ImmutablePair<>(getStringWithFallback(messageId, fallback, paramsForUser), getStringWithFallback(messageId, fallback, paramsForLog));
    }
Given a resource id and parameters to fill it, constructs one message fit for user display (left) and one for log file
(right). Difference is that the one for the log file will contain more detailled information than that for the end user
main/src/main/java/cgeo/geocaching/utils/LocalizationUtils.java