Warning: session_start(): open(/var/lib/php/sessions/sess_rnutnmf3l9oi2abe2v8ml0j17d, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
// TODO: capture all of System.out/System.err
cmodule SystemPrintLog {
int linesToShow = 100, interval = 250;
transient Appendable log; // virtual NotifyingStringBuffer
transient JFastLogView_noWrap view;
transient long changesSeen;
start {
if (dm_getBounds() == null)
dm_setBounds(this, 0, max(0, getHeight(dm_desktopPane())-200), 400, 200);
log = getCreator('print_log);
doEvery(interval, r updateMe);
}
visualize {
ret componentPopupMenuItems(jSection("SYSTEM LOG",
jscroll_copyBackground(view = jFastLogView_noWrap(str(log)))),
"Clear", r { clearStringBuffer_gen(log) },
"Copy to new window", r { showText_fast_noWrap("System Log", log) });
}
void update {
JFastLogView_noWrap _view = view;
if (_view == null) ret;
Long changes = cast getOpt(log, 'changes);
if (changes == null || neq(changes, changesSeen)) {
if (changes != null) changesSeen = changes;
_view.setText(extractLastNLinesOfString(linesToShow, str(log)));
scrollAllTheWayDown(_view);
}
}
}