Unverified Commit a1081ed1 authored by Pavitra Golchha's avatar Pavitra Golchha Committed by GitHub

Make OdeLog to print to brower console also (#2252)

parent 65a1b03c
......@@ -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);
}-*/;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment