!7 cmodule VMBusSnooper > DynPrintLog { switchable bool enabled; switchable bool logToDisk; switchable S filter; // regular expression start { dm_vmBus_onAnyMessage(voidfunc(fS msg, fO _arg) { if (!enabled) ret; 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)); }); } visual centerAndSouthWithMargins(super, centerAndEastWithMargin(dm_fieldWithLabel filter(), jline( dm_fieldCheckBox logToDisk("Log to disk"), dm_fieldCheckBox enabled()))) } }