views:

55

answers:

1

Debug mode in MigLayout is quite powerful option for development and debugging. It is declared by adding a keyword in layout constraints string:

new MigLayout("fill, hidemode 3, debug");

Well, it would be nice to bind MigLayout's debug mode to the logging level of the application. Something like:

MigLayout.setLogger(LoggerFactory.getLogger(MigLayout.class));

MigLayout's debug mode could be then switched on and off declarative, using logging configuration. Is this already possible?

+2  A: 

Try:

new MigLayout("fill, hidemode 3" + (LoggerFactory.getLogger(MigLayout.class).isLoggable(DEBUG) ? ", debug" : ""));
Rastislav Komara