當前位置: 首頁>>代碼示例>>Java>>正文


Java Level.ALL屬性代碼示例

本文整理匯總了Java中org.apache.logging.log4j.Level.ALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Level.ALL屬性的具體用法?Java Level.ALL怎麽用?Java Level.ALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.logging.log4j.Level的用法示例。


在下文中一共展示了Level.ALL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: log4jLevelToLogWriterLevel

public static int log4jLevelToLogWriterLevel(final Level log4jLevel) {
  if (log4jLevel == Level.FATAL) {
    return InternalLogWriter.SEVERE_LEVEL;
  } else if (log4jLevel == Level.ERROR) {
    return InternalLogWriter.ERROR_LEVEL;
  } else if (log4jLevel == Level.WARN) {
    return InternalLogWriter.WARNING_LEVEL;
  } else if (log4jLevel == Level.INFO) {
    return InternalLogWriter.INFO_LEVEL;
  } else if (log4jLevel == Level.DEBUG) {
    return InternalLogWriter.FINE_LEVEL;
  } else if (log4jLevel == Level.TRACE) {
    return InternalLogWriter.FINEST_LEVEL;
  } else if (log4jLevel == Level.ALL) {
    return InternalLogWriter.ALL_LEVEL;
  } else if (log4jLevel == Level.OFF) {
    return InternalLogWriter.NONE_LEVEL;
  }

  throw new IllegalArgumentException("Unknown Log4J level [" + log4jLevel + "].");
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:21,代碼來源:LogWriterLogger.java

示例2: getLogWriterLevel

@Override
public int getLogWriterLevel() {
  final Level log4jLevel = this.logWrapper.getLevel();

  if (log4jLevel == Level.OFF) {
    return InternalLogWriter.NONE_LEVEL;
  } else if (log4jLevel == Level.FATAL) {
    return InternalLogWriter.SEVERE_LEVEL;
  } else if (log4jLevel == Level.ERROR) {
    return InternalLogWriter.ERROR_LEVEL;
  } else if (log4jLevel == Level.WARN) {
    return InternalLogWriter.WARNING_LEVEL;
  } else if (log4jLevel == Level.INFO) {
    return InternalLogWriter.INFO_LEVEL;
  } else if (log4jLevel == Level.DEBUG) {
    return InternalLogWriter.FINE_LEVEL;
  } else if (log4jLevel == Level.TRACE) {
    return InternalLogWriter.FINER_LEVEL;
  } else if (log4jLevel == Level.ALL) {
    return InternalLogWriter.ALL_LEVEL;
  }

  throw new IllegalStateException(
      "Level " + log4jLevel + " could not be mapped to LogWriter level.");
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:25,代碼來源:LogWriterLogger.java

示例3: logWriterLeveltoLog4jLevel

/************************************************************
 * Methods to support backwards compatibility between levels.
 ************************************************************/

public static Level logWriterLeveltoLog4jLevel(final int logWriterLevel) {
  switch (logWriterLevel) {
    case InternalLogWriter.SEVERE_LEVEL:
      return Level.FATAL;
    case InternalLogWriter.ERROR_LEVEL:
      return Level.ERROR;
    case InternalLogWriter.WARNING_LEVEL:
      return Level.WARN;
    case InternalLogWriter.CONFIG_LEVEL:
      return Level.INFO;
    case InternalLogWriter.INFO_LEVEL:
      return Level.INFO;
    case InternalLogWriter.FINE_LEVEL:
      return Level.DEBUG;
    case InternalLogWriter.FINER_LEVEL:
      return Level.DEBUG;
    case InternalLogWriter.FINEST_LEVEL:
      return Level.TRACE;
    case InternalLogWriter.ALL_LEVEL:
      return Level.ALL;
    case InternalLogWriter.NONE_LEVEL:
      return Level.OFF;
  }

  throw new IllegalArgumentException("Unknown LogWriter level [" + logWriterLevel + "].");
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:30,代碼來源:LogWriterLogger.java

示例4: logWriterNametoLog4jLevel

public static Level logWriterNametoLog4jLevel(String levelName) {
  if ("all".equalsIgnoreCase(levelName)) {
    return Level.ALL;
  }
  if ("finest".equalsIgnoreCase(levelName)) {
    return Level.TRACE;
  }
  if ("finer".equalsIgnoreCase(levelName)) {
    return Level.DEBUG;
  }
  if ("fine".equalsIgnoreCase(levelName)) {
    return Level.DEBUG;
  }
  if ("config".equalsIgnoreCase(levelName)) {
    return Level.INFO;
  }
  if ("info".equalsIgnoreCase(levelName)) {
    return Level.INFO;
  }
  if ("warning".equalsIgnoreCase(levelName)) {
    return Level.WARN;
  }
  if ("error".equalsIgnoreCase(levelName)) {
    return Level.ERROR;
  }
  if ("severe".equalsIgnoreCase(levelName)) {
    return Level.FATAL;
  }
  if ("none".equalsIgnoreCase(levelName)) {
    return Level.OFF;
  }

  throw new IllegalArgumentException("Unknown LogWriter level [" + levelName + "].");
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:34,代碼來源:LogWriterLogger.java


注:本文中的org.apache.logging.log4j.Level.ALL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。