Binding MigLayout debug mode to the application's logging level?
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开发者_C百科 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?
Try:
new MigLayout("fill, hidemode 3" + (LoggerFactory.getLogger(MigLayout.class).isLoggable(DEBUG) ? ", debug" : ""));
精彩评论