!7 // TODO: capture all of System.out/System.err sclass SystemPrintLog extends DynModule { transient O log; transient JTextArea ta; void start { log = getCreator('print_log); doEvery(1000, r updateMe); } JComponent visualize() { ret componentPopupMenuItems(jSection("SYSTEM LOG", ta = moveCaretToEnd(typeWriterTextArea(str(log)))), "Clear", r { clearStringBuffer_gen(log) }, "Copy to new window", r { showText("System Log", log) }); } void unvisualize() { ta = null; } void update { if (ta != null) setText(ta, str(log)); } }