LoggerFactory { public static Logger getLogger(String name) { org.slf4j.Logger slf4jLogger = org.slf4j.LoggerFactory.getLogger(name); Logger result = new Logger(slf4jLogger, formatter); configureLogger(result); return result; }  static void setDateFormatString(String dateFormatString); static void setIncludeLoggerName(boolean includeLoggerName); static void setIncludeThreadName(boolean includeThreadName); static void setIncludeClassName(boolean includeClassName); static boolean isIncludeLoggerName(); static boolean isIncludeThreadName(); static boolean isIncludeClassName(); static Logger getLogger(String name); static Logger getLogger(Class<?> clazz);  }
@Test public void testGetLoggerByClass() throws Exception { Logger result = LoggerFactory.getLogger(LoggerFactoryTest.class); org.slf4j.Logger slf4jLogger = (org.slf4j.Logger) Whitebox.getInternalState(result, "slf4jLogger"); assertNotNull(slf4jLogger); assertEquals(LoggerFactoryTest.class.getName(), slf4jLogger.getName()); }
@Test public void testGetLoggerByName() throws Exception { Logger result = LoggerFactory.getLogger("LoggerFactoryTest"); org.slf4j.Logger slf4jLogger = (org.slf4j.Logger) Whitebox.getInternalState(result, "slf4jLogger"); assertNotNull(slf4jLogger); assertEquals("LoggerFactoryTest", slf4jLogger.getName()); }