private static void replace (String source, String pattern, String replace, StringBuffer builder) {
        int pos = 0;
        int pl = pattern.length();
        builder.delete(0, builder.length());
        while (pos < source.length()) {
            int np = source.indexOf(pattern, pos);
            if (np == -1) break;
            builder.append(source.substring(pos, np));
            builder.append(replace);
            pos = np + pl;
        }
        builder.append(source.substring(pos));
    }
tries to log the specified message, if verbosity is higher than its level
main/src/main/java/cgeo/geocaching/wherigo/openwig/Engine.java