public LogWriterLevel fromLevel(final Level level) {
      if (level == Level.ALL) {
        return ALL;
      } else if (level == Level.FATAL) {
        return SEVERE;
      } else if (level == Level.ERROR) {
        return ERROR;
      } else if (level == Level.WARN) {
        return WARNING;
      } else if (level == Level.INFO) {
        return INFO;
      } else if (level == Level.DEBUG) {
        return FINE;
      } else if (level == Level.TRACE) {
        return FINEST;
      } else if (level == Level.OFF) {
        return NONE;
      }

      throw new IllegalArgumentException("No matching AlertLevel for Log4J2 Level " + level + ".");
    }
Converts from a Log4J2 {@code Level} to a {@link LogWriterLevel}.

@param level a Log4J2 {@code Level}
@return the corresponding {@link LogWriterLevel}
@throws IllegalArgumentException if there is no matching Alert
geode-dunit/src/main/java/org/apache/geode/test/dunit/log4j/LogWriterLogger.java