AbstractLoggerFactory implements LoggerFactory { @Override public void setLevel(String path, Level level) { requireNonNull(path); requireNonNull(level); loggers() .filter(e -> e.getKey().startsWith(path) ) .map(Entry::getValue).forEach((Logger l) -> l.setLevel(level) ); } AbstractLoggerFactory(); @Override Logger create(Class<?> binding); @Override Logger create(String binding); @Override synchronized void setFormatter(LoggerFormatter formatter); @Override synchronized LoggerFormatter getFormatter(); abstract Logger make(String binding, LoggerFormatter formatter); @Override void addListener(LoggerEventListener listener); @Override void removeListener(LoggerEventListener listener); @Override Stream<LoggerEventListener> listeners(); @Override Stream<Entry<String, Logger>> loggers(); @Override void setLevel(String path, Level level); @Override void setLevel(Class<?> binding, Level level);  }
@Test void setLevel() { final String binding = "A"; final Logger logger = instance.create(binding); instance.setLevel(binding, Level.FATAL); assertEquals(Level.FATAL, logger.getLevel()); }
@Test void testSetLevel() { final Logger logger = instance.create(AbstractLoggerFactoryTest.class); instance.setLevel(AbstractLoggerFactoryTest.class, Level.FATAL); assertEquals(Level.FATAL, logger.getLevel()); }