Frage

In developing some of my Web Applications I use debug("stuff here"); to help me figure out whats going on. I'd rather not have to go in and find all of my debug(*); lines and remove them. Is there a way I can specify at the application level not to display debug messages in a FeedBackPanel?

War es hilfreich?

Lösung

You could add an ErrorLevelFeedbackMessageFilter to your FeedbackPanels (there is a constructor accepting one). If you create the filter based on your deployment mode, this should be what you need.

In Detail:

Change your new FeedbackPanel("id") to new FeedbackPanel("id", Application.getFeedbackMessageFilter()) and implement this method as

public IFeedbackMessageFilter getFeedbackMessageFilter() {
    IFeedbackMessageFilter filter = null;
    if (RuntimeConfigurationType.DEVELOPMENT.equals(getConfigurationType())) {
        filter = new ErrorLevelFeedbackMessageFilter(FeedbackMessage.DEBUG);
    } else {
        filter = new ErrorLevelFeedbackMessageFilter(FeedbackMessage.ERROR);
    }
    return filter;
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top