开发者

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" : ""));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜