LoggerFactory implements org.slf4j.ILoggerFactory { @Override public org.slf4j.Logger getLogger(String name) { LoggerAdapter logger = loggers.get(name); if (logger == null) { logger = createLogger(name); LoggerAdapter logger2 = loggers.putIfAbsent(name, logger); if (logger2 != null) logger = logger2; } return logger; }  @Override org.slf4j.Logger getLogger(String name);  }
@Test public void testBasic() { Logger log = LoggerFactory.getLogger(LoggerFactoryTest.class); Assert.assertNotNull(log); Logger log2 = LoggerFactory.getLogger(LoggerFactoryTest.class); verifySame(log, log2, true); verifySame(((LoggerAdapter)log).getDelegate(), ((LoggerAdapter)log2).getDelegate(), true); log2 = LoggerFactory.getLogger("anotherclass"); verifySame(log, log2, false); log.info("dummy log1"); log2.info("dummy log2"); }