public static void log (String s, int level) {
        if (instance == null || instance.log == null) return;
        if (level < instance.loglevel) return;
        synchronized (instance.log) {
        Calendar now = Calendar.getInstance();
        instance.log.print(now.get(Calendar.HOUR_OF_DAY));
        instance.log.print(':');
        instance.log.print(now.get(Calendar.MINUTE));
        instance.log.print(':');
        instance.log.print(now.get(Calendar.SECOND));
        instance.log.print('|');
        instance.log.print((int)(gps.getLatitude() * 10000 + 0.5) / 10000.0);
        instance.log.print('|');
        instance.log.print((int)(gps.getLongitude() * 10000 + 0.5) / 10000.0);
        instance.log.print('|');
        instance.log.print(gps.getAltitude());
        instance.log.print('|');
        instance.log.print(gps.getPrecision());
        instance.log.print("|:: ");
        instance.log.println(s);
        instance.log.flush();
        }
    }
tries to log the specified message, if verbosity is higher than its level
main/src/main/java/cgeo/geocaching/wherigo/openwig/Engine.java