public static 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}.

@throws IllegalArgumentException if there is no matching Alert
geode-core/src/main/java/org/apache/geode/logging/internal/log4j/LogWriterLevelConverter.java