Reviewers: unnurg, burdon_google.com,

Description:
Make the logging framework provide a default uncaught exception handler.


Please review this at http://gwt-code-reviews.appspot.com/1223802/show

Affected files:
  M user/src/com/google/gwt/logging/client/LogConfiguration.java


Index: user/src/com/google/gwt/logging/client/LogConfiguration.java
===================================================================
--- user/src/com/google/gwt/logging/client/LogConfiguration.java (revision 9459) +++ user/src/com/google/gwt/logging/client/LogConfiguration.java (working copy)
@@ -18,6 +18,7 @@

 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
 import com.google.gwt.user.client.Window.Location;
 import com.google.gwt.user.client.ui.HasWidgets;

@@ -146,5 +147,16 @@

   public void onModuleLoad() {
     impl.configureClientSideLogging();
+
+    if (impl.loggingIsEnabled()) {
+      if (GWT.getUncaughtExceptionHandler() == null) {
+ final Logger log = Logger.getLogger(LogConfiguration.class.getName());
+        GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
+          public void onUncaughtException(Throwable e) {
+            log.log(Level.SEVERE, e.getMessage(), e);
+          }
+        });
+      }
+    }
   }
 }


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to