Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Using gwt-log's Log.setUncaughtExceptionHandler() in smartgwt module

    I have had numerous times when an exception goes uncaught in my GUI code making it hard to determine what went wrong. To fix this, I am trying to use the Log.setUncaughtExceptionHandler() method in gwt-log so that any such exception would be caught and logged thus making debugging easier. See here for the feature I am trying to use and search for 'setUncaughtExceptionHandler'.

    Has any one gotten this working?

    What is happening for me is that there is a window created to display logs that sits behind and overlapping my GUI. Is suspect this has something to do with the way windowing is handled in smartgwt. Has any one figured out the best way to use Log.setUncaughtExceptionHandler() method in gwt-log that overcomes the problem I mention?

    Thanks for sharing.

    #2
    SmartGWT has the relevant code from gwt-log (with the authors permission) to log such exceptions to System.err. See the source code for com.smartgwt.client.util.LogUtil.setJSNIErrorHandler(). This handler is called automatically so you should see the exceptions logged here. I have noticed that GWT 1.5+ does however swallow some exceptions (even non JSNI ones). I still haven't gotten a full handle on this.

    It is however desirable for users to be able to use gwt-log as well. The gwt-log window sits behing the GUI because the default gwt-log zindex is lower than that of SmartGWT. I've requested Fred to expose this zIndex allowing users to configure it to any value.

    Sanjiv

    Comment


      #3
      Any news on how to make the div logger visible?

      As you point out, it sits under my app.

      Any idea's on how to make this visible?

      Comment


        #4
        I wish this worked as well...I don't have the time right now to hack up other people's code though. Guess I'll send an email to the author..

        Comment


          #5
          Fred has added the solution to his wiki:

          http://code.google.com/p/gwt-log/wiki/GettingStarted

          # Adjust the z-index of the DivLogger panel

          * Review the gwt-log.css file to see the CSS which is injected into your application by gwt-log
          * Override the z-index (using !important if necessary) by adding a new rule to your application's CSS, e.g.

          .log-panel {
          z-index: 2000;
          }

          or

          .log-panel {
          z-index: 2000 !important;
          }

          Comment


            #6
            Originally posted by Phy6
            Fred has added the solution to his wiki:

            http://code.google.com/p/gwt-log/wiki/GettingStarted
            Did anyone get the z-index solution to work so gwt-log window is not obscured?
            If so could you please share what you had to do?

            This solution did not change anything for me (DivLogger window still obscured behind smartgwt components). Thanks.

            Comment


              #7
              Originally posted by farrukh_najmi
              Did anyone get the z-index solution to work so gwt-log window is not obscured?
              If so could you please share what you had to do?

              This solution did not change anything for me (DivLogger window still obscured behind smartgwt components). Thanks.
              Answering my own question. Here is a solution.

              -Disable the default DivLogger as described here

              -Create a LogDialog using SmartClient Window with a new DivLogger's Widget added as child component

              -Add a context menu action to display the LogDialog on demand

              -Add a custom Logger impl to auto-show the the LogDialog for a log level greater than specified threshold

              This all seems to work nicely. If there is interest I can contribute this so smartgwt-extension project.
              Last edited by farrukh_najmi; 21 Aug 2009, 12:46.

              Comment

              Working...
              X