Make OdeLog to print to brower console also
@@ -94,6 +94,7 @@ public final class OdeLog extends Composite {
*/
public static void log(String message) {
if (isLogAvailable() && !Ode.isWindowClosing()) {
+ consoleInfo(message);
getOdeLog().println(StringUtils.escape(message));
}
}
@@ -105,6 +106,7 @@ public final class OdeLog extends Composite {
*/
public static void wlog(String message) {
if (isLogAvailable() && !Ode.isWindowClosing()) {
+ consoleWarn(message);
getOdeLog().wprintln(StringUtils.escape(message));
}
}
@@ -116,6 +118,7 @@ public final class OdeLog extends Composite {
*/
public static void elog(String message) {
if (isLogAvailable() && !Ode.isWindowClosing()) {
+ consoleError(message);
getOdeLog().eprintln(StringUtils.escape(message));
}
}
@@ -210,4 +213,20 @@ public final class OdeLog extends Composite {
text.setText("");
}
}
+
+ static native void consoleLog(String message) /*-{
+ console.log(message);
+ }-*/;
+
+ static native void consoleInfo(String message) /*-{
+ console.info(message);
+ }-*/;
+
+ static native void consoleWarn(String message) /*-{
+ console.warn(message);
+ }-*/;
+
+ static native void consoleError(String message) /*-{
+ console.error(message);
+ }-*/;
}
