View Javadoc

    1   package org.slf4j.event;
    2
    3   import static org.slf4j.event.EventConstants.DEBUG_INT;
    4   import static org.slf4j.event.EventConstants.ERROR_INT;
    5   import static org.slf4j.event.EventConstants.INFO_INT;
    6   import static org.slf4j.event.EventConstants.TRACE_INT;
    7   import static org.slf4j.event.EventConstants.WARN_INT;
    8
    9   /**
    10   *
    11   * @author ceki
    12   * @since 1.7.15
    13   */
    14  public enum Level {
    15
    16      ERROR(ERROR_INT, "ERROR"), WARN(WARN_INT, "WARN"), INFO(INFO_INT, "INFO"), DEBUG(DEBUG_INT, "DEBUG"), TRACE(TRACE_INT, "TRACE");
    17
    18      private int levelInt;
    19      private String levelStr;
    20
    21      Level(int i, String s) {
    22          levelInt = i;
    23          levelStr = s;
    24      }
    25
    26      public int toInt() {
    27          return levelInt;
    28      }
    29
    30      /**
    31       * Returns the string representation of this Level.
    32       */
    33      public String toString() {
    34          return levelStr;
    35      }
    36
    37  }