LoggerUtil { public static ImmutableMap<String, String> getPatternLevels() { return ImmutableMap.copyOf(Maps.transformValues(patternLevel, levelToString)); }  static ImmutableMap<String, String> getPatternLevels(); static synchronized void changeLoggersLevel(@Nonnull Map<String, String> targetChanges); static synchronized ImmutableMap<String, String> getClassesMatching(@Nonnull String searchKey); static LogFileInformation getLogFileInformation(); static LogFileInformation getLogFileInformation(org.slf4j.Logger logger); static LogFileInformation getLogFileInformation(Logger logger); static boolean addAppender(String name, Properties properties); static boolean addAppender(Logger logger, String name, Properties properties); static boolean addAppenders(String[] names, String args, String propertySeparator); static boolean addAppenders(Logger logger, String[] names, String args, String propertySeparator); static boolean addAppenders(); static boolean removeAppender(String name); static boolean removeAppender(Logger logger, String name); static List<String> getAppendersNames(); static List<String> getAppendersNames(Logger logger); static void setupMDC(String service);  }
@Test public void testGetPatternLevels() { Map<String, String> changes = Maps.newHashMap(); changes.put("_.org.apache.*", "WARN"); changes.put("_.com.datatorrent.io.fs.*", "DEBUG"); changes.put("_.com.datatorrent.io.*", "ERROR"); LoggerUtil.changeLoggersLevel(changes); Map<String, String> levels = LoggerUtil.getPatternLevels(); assertEquals(3, levels.size()); assertEquals(levels.get("_.org.apache.*"), "WARN"); assertEquals(levels.get("_.com.datatorrent.io.fs.*"), "DEBUG"); assertEquals(levels.get("_.com.datatorrent.io.*"), "ERROR"); changes.clear(); changes.put("_.com.datatorrent.*", "WARN"); LoggerUtil.changeLoggersLevel(changes); levels = LoggerUtil.getPatternLevels(); assertEquals(2, levels.size()); assertEquals(levels.get("_.org.apache.*"), "WARN"); assertNull(levels.get("_.com.datatorrent.io.fs.*")); assertNull(levels.get("_.com.datatorrent.io.*")); assertEquals(levels.get("_.com.datatorrent.*"), "WARN"); }