当前位置: 首页>>代码示例>>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;未经允许,请勿转载。