public HasWidgetsLogHandler(HasWidgets container) { this.widgetContainer = container; setFormatter(new HtmlLogFormatter(true)); setLevel(Level.ALL); }
public DevelopmentModeLogHandler() { setFormatter(new TextLogFormatter(false)); setLevel(Level.ALL); }
public SystemLogHandler() { setFormatter(new TextLogFormatter(true)); setLevel(Level.ALL); }
public ConsoleLogHandler() { setFormatter(new TextLogFormatter(true)); setLevel(Level.ALL); }
public void configureClientSideLogging() { assert GWT.isClient(); root = Logger.getLogger(""); // In DevMode, this root logger will have a parent and we do not want this // root logger to pass messages to it's parent, so we set // useParentHandlers to false here. root.setUseParentHandlers(false); setLevels(root); setDefaultHandlers(root); }
@Override public void add(Widget w) { logArea.add(w); scrollPanel.setScrollPosition(scrollPanel.getElement().getScrollHeight()); }
public static boolean loggingIsEnabled() { if (impl == null) { // case when GWTMockUtilities.disarm(); should be optimized out when compiled to JS return true; } return impl.loggingIsEnabled(); }
@Override public void handleDrag(int absX, int absY) { scrollPanel.incrementPixelSize(absX, absY); } }
public PopupLogHandler() { super(new LoggingPopup()); } }
public void incrementPixelSize(int width, int height) { setPixelSize(scrollPanelWidth + width, scrollPanelHeight + height); }
public SimpleRemoteLogHandler() { service = (RemoteLoggingServiceAsync) GWT.create(RemoteLoggingService.class); this.callback = new DefaultCallback(); }
private void setDefaultHandlers(Logger l) { // Add the default handlers. If users want some of these disabled, they // will specify that in the gwt.xml file, which will replace the handler // with an instance of NullLogHandler, effectively disabling it. Handler console = GWT.create(ConsoleLogHandler.class); addHandlerIfNotNull(l, console); Handler dev = GWT.create(DevelopmentModeLogHandler.class); addHandlerIfNotNull(l, dev); Handler system = GWT.create(SystemLogHandler.class); addHandlerIfNotNull(l, system); Handler remote = GWT.create(SimpleRemoteLogHandler.class); addHandlerIfNotNull(l, remote); Handler loggingWidget = GWT.create(HasWidgetsLogHandler.class); addHandlerIfNotNull(l, loggingWidget); }
@Override public void setWidget(Widget w) { logArea.clear(); add(w); } }
@Override public void publish(LogRecord record) { if (isLoggable(record)) { service.logOnServer(record, callback); } } }
public static String throwableAsJson(Throwable t) { return throwableAsJsonObject(t).toString(); }
public static String logRecordAsJson(LogRecord lr) { return logRecordAsJsonObject(lr).toString(); }
private static JSONObject stackTraceElementAsJsonObject( StackTraceElement e) { JSONObject obj = new JSONObject(); if (e != null) { obj.put("className", getJsonString(e.getClassName())); obj.put("fileName", getJsonString(e.getFileName())); obj.put("methodName", getJsonString(e.getMethodName())); obj.put("lineNumber", getJsonString("" + e.getLineNumber())); } return obj; }
public void onClick(ClickEvent event) { if (maxmin.getText().equals("Minimize")) { maxmin.setText("Maximize"); scrollPanel.setVisible(false); resizeIcon.setVisible(false); } else { scrollPanel.setVisible(true); resizeIcon.setVisible(true); maxmin.setText("Minimize"); } } });
public void onMouseMove(MouseMoveEvent event) { if (dragging) { handleDrag(event.getClientX() - dragStartX, event.getClientY() - dragStartY); dragStartX = event.getClientX(); dragStartY = event.getClientY(); } }
public static boolean loggingIsEnabled(Level level) { if (impl == null) { // case when GWTMockUtilities.disarm(); should be optimized out when compiled to JS return true; } return impl.loggingIsEnabled(level); }