LogWriterImpl implements InternalLogWriter { public static String levelToString(int level) { switch (level) { case ALL_LEVEL: return "all"; case FINEST_LEVEL: return "finest"; case FINER_LEVEL: return "finer"; case FINE_LEVEL: return "fine"; case CONFIG_LEVEL: return "config"; case INFO_LEVEL: return "info"; case WARNING_LEVEL: return "warning"; case ERROR_LEVEL: return "error"; case SEVERE_LEVEL: return "severe"; case NONE_LEVEL: return "none"; default: return levelToStringSpecialCase(level); } } protected  LogWriterImpl(); @Override abstract int getLogWriterLevel(); @Override boolean isSecure(); static String allowedLogLevels(); static String levelToString(int level); static String join(Object[] array); static String join(Object[] array, String joinString); static String join(List<?> list); static String join(List<?> list, String joinString); static int levelNameToCode(String levelName); @Override boolean severeEnabled(); @Override void severe(String message, Throwable throwable); @Override void severe(String message); @Override void severe(Throwable throwable); @Override void severe(StringId messageId, Object[] parameters, Throwable throwable); @Override void severe(StringId messageId, Object parameter, Throwable throwable); @Override void severe(StringId messageId, Throwable throwable); @Override void severe(StringId messageId, Object[] parameters); @Override void severe(StringId messageId, Object parameter); @Override void severe(StringId messageId); @Override boolean errorEnabled(); @Override void error(String message, Throwable throwable); @Override void error(String message); @Override void error(Throwable throwable); @Override void error(StringId messageId, Object[] parameters, Throwable throwable); @Override void error(StringId messageId, Object parameter, Throwable throwable); @Override void error(StringId messageId, Throwable throwable); @Override void error(StringId messageId, Object[] parameters); @Override void error(StringId messageId, Object parameter); @Override void error(StringId messageId); @Override boolean warningEnabled(); @Override void warning(String message, Throwable throwable); @Override void warning(String message); @Override void warning(Throwable throwable); @Override void warning(StringId messageId, Object[] parameters, Throwable throwable); @Override void warning(StringId messageId, Object parameter, Throwable throwable); @Override void warning(StringId messageId, Throwable throwable); @Override void warning(StringId messageId, Object[] parameters); @Override void warning(StringId messageId, Object parameter); @Override void warning(StringId messageId); @Override boolean infoEnabled(); @Override void info(String message, Throwable throwable); @Override void info(String message); @Override void info(Throwable throwable); @Override void info(StringId messageId, Object[] parameters, Throwable throwable); @Override void info(StringId messageId, Object parameter, Throwable throwable); @Override void info(StringId messageId, Throwable throwable); @Override void info(StringId messageId, Object[] parameters); @Override void info(StringId messageId, Object parameter); @Override void info(StringId messageId); @Override boolean configEnabled(); @Override void config(String message, Throwable throwable); @Override void config(String message); @Override void config(Throwable throwable); @Override void config(StringId messageId, Object[] parameters, Throwable throwable); @Override void config(StringId messageId, Object parameter, Throwable throwable); @Override void config(StringId messageId, Throwable throwable); @Override void config(StringId messageId, Object[] parameters); @Override void config(StringId messageId, Object parameter); @Override void config(StringId messageId); @Override boolean fineEnabled(); @Override void fine(String message, Throwable throwable); @Override void fine(String message); @Override void fine(Throwable throwable); @Override boolean finerEnabled(); @Override void finer(String message, Throwable throwable); @Override void finer(String message); @Override void finer(Throwable throwable); @Override void entering(String sourceClass, String sourceMethod); @Override void exiting(String sourceClass, String sourceMethod); @Override void throwing(String sourceClass, String sourceMethod, Throwable thrown); @Override boolean finestEnabled(); @Override void finest(String message, Throwable throwable); @Override void finest(String message); @Override void finest(Throwable throwable); void startup(StringId msgID, Object[] params); @Override abstract void put(int messageLevel, String message, Throwable throwable); @Override abstract void put(int messageLevel, StringId messageId, Object[] parameters,
      Throwable throwable); void log(int level, String message, Throwable thrown); void log(int level, String message); @Override Handler getHandler(); static String getStackTrace(Throwable throwable); void logTraces(final boolean toStdout, final Thread targetThread, final int interval,
      final AtomicBoolean done); static StringBuilder getStackTrace(Thread targetThread); @Override LogWriter convertToLogWriter(); @Override LogWriterI18n convertToLogWriterI18n(); static void setStartupListener(StartupStatusListener mainListener); static StartupStatusListener getStartupListener();  }
@Test public void testLevelToString() { assertThat(LogWriterImpl.levelToString(Integer.MIN_VALUE)).isEqualTo("all"); assertThat(LogWriterImpl.levelToString(300)).isEqualTo("finest"); assertThat(LogWriterImpl.levelToString(400)).isEqualTo("finer"); assertThat(LogWriterImpl.levelToString(500)).isEqualTo("fine"); assertThat(LogWriterImpl.levelToString(700)).isEqualTo("config"); assertThat(LogWriterImpl.levelToString(800)).isEqualTo("info"); assertThat(LogWriterImpl.levelToString(900)).isEqualTo("warning"); assertThat(LogWriterImpl.levelToString(950)).isEqualTo("error"); assertThat(LogWriterImpl.levelToString(1000)).isEqualTo("severe"); assertThat(LogWriterImpl.levelToString(Integer.MAX_VALUE)).isEqualTo("none"); assertThat(LogWriterImpl.levelToString(600)).isEqualTo("level-600"); }