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


Java Level.WARN_INT屬性代碼示例

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


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

示例1: convertMsgLevel

private int convertMsgLevel( org.apache.log4j.Level level ) {

        switch (level.toInt()) {
            case Level.FATAL_INT:
                return 1;
            case Level.ERROR_INT:
                return 2;
            case Level.WARN_INT:
                return 3;
            case Level.INFO_INT:
                return 4;
            case Level.DEBUG_INT:
                return 5;
            case Level.TRACE_INT:
                return 6;
            case SystemLogLevel.SYSTEM_INT:
                return 7;
            default:
                return 4;
        }
    }
 
開發者ID:Axway,項目名稱:ats-framework,代碼行數:21,代碼來源:DbEventRequestProcessor.java

示例2: getLogLevels

/**
 * Return a long containing the encoded status of every log level for the relevant loggers.
 * @return A long containing log levels for all the loggers available in the EE
 */
public final static long getLogLevels() {
    long logLevels = 0;
    for (int ii = 0; ii < loggers.length; ii++) {
        final int level = loggers[ii].getEffectiveLevel().toInt();
        switch (level) {
        case Level.TRACE_INT:
            logLevels |= trace << (ii * 3);
            break;
        case Level.ALL_INT:
            logLevels |= all << (ii * 3);
            break;
        case Level.DEBUG_INT:
            logLevels |= debug << (ii * 3);
            break;
        case Level.ERROR_INT:
            logLevels |= error << (ii * 3);
            break;
        case Level.FATAL_INT:
            logLevels |= fatal << (ii * 3);
            break;
        case Level.INFO_INT:
            logLevels |= info << (ii * 3);
            break;
        case Level.OFF_INT:
            logLevels |= off << (ii * 3);
            break;
        case Level.WARN_INT:
            logLevels |= warn << (ii * 3);
            break;
            default:
                throw new RuntimeException("Unhandled log level " + level);
        }
    }
    return logLevels;
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:39,代碼來源:EELoggers.java

示例3: writeToLog

private void writeToLog(final String s) {
  if ((s == null) || s.isEmpty()) {
    return;
  }

  switch(level) {
  case Level.DEBUG_INT:
    logger.debug(s);
    break;

  case Level.ERROR_INT:
    logger.error(s);
    break;

  case Level.INFO_INT:
    logger.info(s);
    break;

  case Level.TRACE_INT:
    logger.trace(s);
    break;

  case Level.WARN_INT:
    logger.warn(s);
    break;

  default:
    throw new IllegalStateException();
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:30,代碼來源:LogWriter.java


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