Announcement

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

  • How to configure client-side logging system

    Hi,

    In some cases, smartgwt can flood the browser console with Warning logs like below:

    0:59:22.210:WARN:drawing:isc_MyViewWidget_0_body_vscroll:negative or zero area: height: 0, width: 16, refusing to draw (here the application is integrated in an iframe, but not yet displayed)

    As I did not find helpful things to prevent this on this forum, please find below a programmatic way to setup the client side logging system (which is also based on categories / levels like any standard logging system) :

    Code:
        public static native void configureIsomorphicClientLoggingSystem()
        /*-{
             try {
                $wnd.isc.Log.setPriority("drawing",$wnd.isc.Log.ERROR);
                $wnd.isc.Log.setPriority("GridBody",$wnd.isc.Log.ERROR);
            } catch (error) {
                console.log(error);
            }
        }-*/;
    This would at least let you adjust default priorities (level thresholds) at runtime.
    Of course this method should be invoked at very beginning of initialization

  • #2
    Sometimes, when you don't see a way to do something, it's because you shouldn't do it..

    Setting those priorities will turn off important warnings. No one should ever use the approach you've shown here.

    The problems in your app are:

    1. you say the application isn't displayed yet, but, the components are being drawn, that's why you're getting warnings. You shouldn't draw it until it's displayed

    2. you seem to be sizing the iframe to an extremely small size. This would be fine if you weren't drawing yet, but if you try to draw into a tiny space, you're going to get warnings *because that's really a problem*. So size the iframe to a reasonable size before drawing.

    Comment

    Working...
    X