static void logOutput2() {
_logFile = getProgramFile(ymd() + "-" + hms() + ".txt");
if (_logFile.exists()) sleep(50); else break;
final File logFile = _logFile;
set(getJavaX(), "customSystemOut", new Appendable() {
public Appendable append(CharSequence cs) {
appendToTextFile(logFile, cs.toString());
public Appendable append(char c) { return this; }
public Appendable append(CharSequence s, int start, int end) {
return this; }