aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-04-02 22:29:59 +0300
committerArtur Signell <artur@vaadin.com>2012-04-05 00:08:15 +0300
commit9a9269d57a82159cd218bd992a9eab4bbc251f89 (patch)
tree7520ef7d5f785012ffab4c785e15a1c7022c67ce
parentf57bb5da8cb10a7dec5184fdf615424a34138447 (diff)
downloadvaadin-framework-9a9269d57a82159cd218bd992a9eab4bbc251f89.tar.gz
vaadin-framework-9a9269d57a82159cd218bd992a9eab4bbc251f89.zip
Added timestamps to debug window output
-rw-r--r--src/com/vaadin/terminal/gwt/client/VDebugConsole.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
index 8067f0077e..f28af4040d 100644
--- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
+++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
@@ -5,6 +5,7 @@
package com.vaadin.terminal.gwt.client;
import java.util.Collection;
+import java.util.Date;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -31,6 +32,7 @@ import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.UrlBuilder;
+import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
@@ -330,6 +332,7 @@ public class VDebugConsole extends VOverlay implements Console {
if (msg == null) {
msg = "null";
}
+ msg = addTimestamp(msg);
// remoteLog(msg);
logToDebugWindow(msg, false);
@@ -421,7 +424,7 @@ public class VDebugConsole extends VOverlay implements Console {
if (msg == null) {
msg = "null";
}
-
+ msg = addTimestamp(msg);
logToDebugWindow(msg, true);
GWT.log(msg);
@@ -430,6 +433,15 @@ public class VDebugConsole extends VOverlay implements Console {
}
+ DateTimeFormat timestampFormat = DateTimeFormat.getFormat("HH:mm:ss:SSS");
+
+ @SuppressWarnings("deprecation")
+ private String addTimestamp(String msg) {
+ Date date = new Date();
+ String timestamp = timestampFormat.format(date);
+ return timestamp + " " + msg;
+ }
+
/*
* (non-Javadoc)
*