long ts = System.currentTimeMillis();
logger.info(String.format("%s -- %d%% memory available (total %d Mb)", formatter
.format(Calendar.getInstance().getTime()), Memory.percAvailableMemory(),
Memory.maxMemory() / (1024 * 1024)));
int i = 0;
LoggerPrintStream out = new LoggerPrintStream(logger, Level.INFO);
synchronized (tasks) {
for (Task task : tasks) {
i++;
final int size = tasks.size();
out.format("\t[%d/%d] ", i, size);
task.print(ts, out);
out.flush();
}
}
}