The Wicket DebugBar
from wicket-devutils
adds a lot of useful information when debugging session / serialization issues. The documentation suggest that it should be added to a base page.
This approach seems to provide very weak support for differentiating between development and production environment. I don't want wicket-devutils
as a production dependency and I most certainly do not want to clutter the code with "if development" branches.
How do "Wicket" people deal with this in real life applications? Are there any established patterns?
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/devutils/debugbar/DebugBar.html
DebugBar
already overrides isVisible
. So you do not have to do anything.
@Override
public boolean isVisible()
{
return getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled();
}
In our case, we only add it when development utilities are enabled.
if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
add(new DebugBar("dev"));
} else {
add(new EmptyPanel("dev").setVisible(false));
}
The dependency is not that big, it is ok for us to let it in our production dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With