Log4jUtil { public static Level parseLevel(String s) { if (s.equalsIgnoreCase("INFO")) { return Level.INFO; } else if (s.equalsIgnoreCase("ERROR")) { return RenamedLevel.ERROR; } else if (s.equalsIgnoreCase("FATAL")) { return RenamedLevel.FATAL; } else if (s.equalsIgnoreCase("WARN")) { return RenamedLevel.WARN; } else if (s.equalsIgnoreCase("DEBUG")) { return RenamedLevel.DEBUG; } else if (s.equalsIgnoreCase("TRACE")) { return RenamedLevel.TRACE; } LOGGER.error("Level \"" + s + "\" not parsed!"); return null; }  static LogData translateLog4j(LoggingEvent event); static Level parseLevel(String s); static void parsePattern(Properties p); static final String CONVERSION_PATTERN; }
@Test public void testParseLevel() { assertEquals(Level.FINEST, Log4jUtil.parseLevel("TRACE")); assertEquals(Level.FINE, Log4jUtil.parseLevel("DEBUG")); assertEquals(Level.INFO, Log4jUtil.parseLevel("INFO")); assertEquals(Level.WARNING, Log4jUtil.parseLevel("WARN")); assertEquals(Level.SEVERE, Log4jUtil.parseLevel("ERROR")); assertEquals(Level.SEVERE, Log4jUtil.parseLevel("FATAL")); }