@Test
 public void testLogUsingCustomLevel() throws Exception {
   logger.config("Config level");
   final List<LogEvent> events = eventAppender.getEvents();
   assertThat(events, hasSize(1));
   final LogEvent event = events.get(0);
   assertThat(event.getLevel(), equalTo(LevelTranslator.CONFIG));
 }
 @Test
 public void testLogParamMarkers() {
   final Logger flowLogger = Logger.getLogger("TestFlow");
   flowLogger.logp(
       java.util.logging.Level.FINER, "sourceClass", "sourceMethod", "ENTRY {0}", "params");
   final List<LogEvent> events = flowAppender.getEvents();
   assertEquals("ENTRY params", events.get(0).getMessage().getFormattedMessage());
 }
 @Test
 public void testLog() throws Exception {
   logger.info("Informative message here.");
   final List<LogEvent> events = eventAppender.getEvents();
   assertThat(events, hasSize(1));
   final LogEvent event = events.get(0);
   assertThat(event, instanceOf(Log4jLogEvent.class));
   assertEquals(Level.INFO, event.getLevel());
   assertEquals(LOGGER_NAME, event.getLoggerName());
   assertEquals("Informative message here.", event.getMessage().getFormattedMessage());
   assertEquals(ApiLogger.class.getName(), event.getLoggerFqcn());
 }
 private void testMessage(String string) {
   final Logger root = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
   root.info("Test info " + string);
   root.config("Test info " + string);
   root.fine("Test info " + string);
   final List<LogEvent> events = eventAppender.getEvents();
   assertThat(events, hasSize(3));
   for (final LogEvent event : events) {
     final String message = event.getMessage().getFormattedMessage();
     assertThat(message, equalTo("Test info " + string));
   }
 }
 @Test
 public void testGlobalLogger() throws Exception {
   final Logger root = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
   root.info("Test info message");
   root.config("Test info message");
   root.fine("Test info message");
   final List<LogEvent> events = eventAppender.getEvents();
   assertThat(events, hasSize(3));
   for (final LogEvent event : events) {
     final String message = event.getMessage().getFormattedMessage();
     assertThat(message, equalTo("Test info message"));
   }
 }
 @Test
 public void testFlowMessages() {
   final Logger flowLogger = Logger.getLogger("TestFlow");
   flowLogger.entering("com.example.TestSourceClass1", "testSourceMethod1(String)");
   flowLogger.entering("com.example.TestSourceClass2", "testSourceMethod2(String)", "TestParam");
   flowLogger.entering(
       "com.example.TestSourceClass3",
       "testSourceMethod3(String)",
       new Object[] {"TestParam0", "TestParam1"});
   final List<LogEvent> events = flowAppender.getEvents();
   assertThat(events, hasSize(3));
   assertEquals("entry", events.get(0).getMessage().getFormattedMessage());
   assertEquals("entry params(TestParam)", events.get(1).getMessage().getFormattedMessage());
   assertEquals(
       "entry params(TestParam0, TestParam1)", events.get(2).getMessage().getFormattedMessage());
 }