!7 // TODO: This is still super easy to crash // as it tries to record every internal VM bus message // for things like threads and locks. We need a different // approach here - just collect in a list!? cmodule2 VMBusSnooper > DynPrintLog { switchable bool enabled; switchable bool logToDisk; switchable bool showStackTraces; switchable S filter = ""; // regular expression start { q(); // make sure to create queue because creating it // while handling a VM bus message is really bad /*dm_vmBus_onAnyMessage(voidfunc(fS msg, fO _arg) { if (!enabled || empty(filter)) ret; Throwable stackTrace = showStackTraces ? new Throwable : null; switch to q(); O arg = _arg; if (!regexpFindIC(filter, msg)) ret; if (arg instanceof O[]) arg = joinWithComma(allToString((O[]) arg)); S s = msg + (arg == null ? "" : " | " + arg); print(localTimeWithSeconds() + " " + shorten(s, 200)); if (logToDisk) programLog(shorten(s, 1024)); if (stackTrace != null) printStackTrace(stackTrace); });*/ } visual centerAndSouthWithMargins(super, centerAndEastWithMargin(dm_fieldWithLabel filter(), jline( dm_fieldCheckBox logToDisk(), dm_fieldCheckBox showStackTraces(), dm_fieldCheckBox enabled()))) ; }