ZlgHandler extends Handler { @Override public void publish(LogRecord record) { zlg .level(JulMappings.mapLevel(record.getLevel())) .format("%s") .arg(Args.map(Args.ref(record), simpleFormatter::formatMessage)) .threw(record.getThrown()) .entrypoint(entrypoint) .log(); } ZlgHandler();   ZlgHandler(Zlg zlg); @Override void publish(LogRecord record); @Override void flush(); @Override void close();  }
@Test public void testPublish() { final MockLogTarget target = new MockLogTarget(); final ZlgHandler handler = new ZlgHandler(target.logger()); final LogRecord record = new LogRecord(Level.FINE, "Pi is {0}"); record.setParameters(new Object[] {3.14}); handler.publish(record); target.entries().assertCount(1); target.entries().forLevel(LogLevel.DEBUG).withMessage("Pi is 3.14").assertCount(1); }