### Question:
Logger implements LogProducer,Configurable { public static void log (LogEvent evt) { Logger l = null; LogSource source = evt.getSource(); if (source != null) l = source.getLogger(); if (l == null && !evt.isHonorSourceLogger()) { l = getLogger(Q2.LOGGER_NAME); } if (l != null && l.hasListeners ()) { Iterator i = l.listeners.iterator(); while (i.hasNext() && evt != null) { try { evt = ((LogListener) i.next()).log(evt); } catch (ConcurrentModificationException e) { break; } catch (Throwable t) { evt.addMessage (t); } } } } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); static void log(LogEvent evt); void setName(String name); void destroy(); synchronized static Logger getLogger(String name); String getName(); boolean hasListeners(); static final String NRPREFIX; }### Answer:
@Test public void testLog() throws Throwable { Logger.log(new LogEvent(new SimpleLogSource(Logger.getLogger("testLoggerName"), "testLoggerRealm"), "testLoggerTag", "testString")); assertTrue(true, "Test completed without Exception"); }
@Test public void testLog1() throws Throwable { Logger.log(new LogEvent(new Log(), "testLoggerTag", "testString")); assertTrue(true, "Test completed without Exception"); }
@Test public void testLog2() throws Throwable { Logger.log(new LogEvent(null, "testLoggerTag", "")); assertTrue(true, "Test completed without Exception"); }
@Test public void testLogThrowsNullPointerException() throws Throwable { try { Logger.log(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull(ex.getMessage(), "ex.getMessage()"); } }