!7 cmodule VMBusSnooper > DynPrintLogAndEnabled { bool logToDisk; start { dm_vmBus_onAnyMessage(voidfunc(fS msg, fO _arg) { if (!enabled) ret; switch to q(); O arg = _arg; 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)); }); } afterVisualize { addComponent(buttons, dm_fieldCheckBox('logToDisk, "Log to disk")); } }