org.apache.log4j.Logger.getEffectiveLevel()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中org.apache.log4j.Logger.getEffectiveLevel()方法的一些代码示例,展示了Logger.getEffectiveLevel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.getEffectiveLevel()方法的具体详情如下:
包路径:org.apache.log4j.Logger
类名称:Logger
方法名:getEffectiveLevel

Logger.getEffectiveLevel介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

private static void process(org.apache.log4j.Logger log, String level,
  PrintWriter out) throws IOException {
 if (level != null) {
  if (!level.equals(org.apache.log4j.Level.toLevel(level).toString())) {
   out.println(MARKER + "<div class='text-danger'>" + "Bad level : <strong>" + level
     + "</strong><br />" + "</div>");
  } else {
   log.setLevel(org.apache.log4j.Level.toLevel(level));
   out.println(MARKER + "<div class='text-success'>" + "Setting Level to <strong>" + level
     + "</strong> ...<br />" + "</div>");
  }
 }
 out.println(MARKER
   + "Effective level: <b>" + log.getEffectiveLevel() + "</b><br />");
}

代码示例来源:origin: log4j/log4j

/**
 * Check whether this category is enabled for the TRACE  Level.
 * @since 1.2.12
 *
 * @return boolean - <code>true</code> if this category is enabled for level
 *         TRACE, <code>false</code> otherwise.
 */
public boolean isTraceEnabled() {
  if (repository.isDisabled(Level.TRACE_INT)) {
    return false;
   }
   return Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel());
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

private static void process(org.apache.log4j.Logger log, String level,
  PrintWriter out) throws IOException {
 if (level != null) {
  if (!level.equalsIgnoreCase(org.apache.log4j.Level.toLevel(level)
    .toString())) {
   out.println(MARKER + "Bad Level : <b>" + level + "</b><br />");
  } else {
   log.setLevel(org.apache.log4j.Level.toLevel(level));
   out.println(MARKER + "Setting Level to " + level + " ...<br />");
  }
 }
 out.println(MARKER
   + "Effective Level: <b>" + log.getEffectiveLevel() + "</b><br />");
}

代码示例来源:origin: hibernate/hibernate-orm

public boolean isEnabled(final Level level) {
  final org.apache.log4j.Level l = translate( level );
  return logger.isEnabledFor( l ) && l.isGreaterOrEqual( logger.getEffectiveLevel() );
}

代码示例来源:origin: wildfly/wildfly

public boolean isEnabled(final Level level) {
  final org.apache.log4j.Level l = translate(level);
  return logger.isEnabledFor(l) && l.isGreaterOrEqual(logger.getEffectiveLevel());
}

代码示例来源:origin: log4j/log4j

if(event.getLevel().isGreaterOrEqual(remoteLogger.getEffectiveLevel())) {

代码示例来源:origin: log4j/log4j

/**
 * Log a message object with the {@link org.apache.log4j.Level#TRACE TRACE} level.
 *
 * @param message the message object to log.
 * @see #debug(Object) for an explanation of the logic applied.
 * @since 1.2.12
 */
public void trace(Object message) {
 if (repository.isDisabled(Level.TRACE_INT)) {
  return;
 }
 if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
  forcedLog(FQCN, Level.TRACE, message, null);
 }
}

代码示例来源:origin: marytts/marytts

private void expandSayasElements(Document doc) {
  NodeList sayasElements = doc.getElementsByTagName(MaryXML.SAYAS);
  for (int i = 0; i < sayasElements.getLength(); i++) {
    Element sayas = (Element) sayasElements.item(i);
    String type = sayas.getAttribute("type");
    ExpansionPattern ep = ExpansionPattern.getPattern(type);
    if (ep != null) {
      if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
        logger.debug("Expanding say-as element of type " + type + ", containing text `"
            + MaryDomUtils.getPlainTextBelow(sayas) + "'");
      }
      ep.match(sayas, type);
    } else {
      // Don't know how to handle type -- ignore
      logger.info("Don't know how to expand say-as type=\"" + type + "\"");
    }
  }
}

代码示例来源:origin: marytts/marytts

private void expandSayasElements(Document doc) {
  NodeList sayasElements = doc.getElementsByTagName(MaryXML.SAYAS);
  for (int i = 0; i < sayasElements.getLength(); i++) {
    Element sayas = (Element) sayasElements.item(i);
    String type = sayas.getAttribute("type");
    ExpansionPattern ep = ExpansionPattern.getPattern(type);
    if (ep != null) {
      if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
        logger.debug("Expanding say-as element of type " + type + ", containing text `"
            + MaryDomUtils.getPlainTextBelow(sayas) + "'");
      }
      ep.match(sayas, type);
    } else {
      // Don't know how to handle type -- ignore
      logger.info("Don't know how to expand say-as type=\"" + type + "\"");
    }
  }
}

代码示例来源:origin: marytts/marytts

private void expandSayasElements(Document doc) {
  NodeList sayasElements = doc.getElementsByTagName(MaryXML.SAYAS);
  for (int i = 0; i < sayasElements.getLength(); i++) {
    Element sayas = (Element) sayasElements.item(i);
    String type = sayas.getAttribute("type");
    ExpansionPattern ep = ExpansionPattern.getPattern(type);
    if (ep != null) {
      if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
        logger.debug("Expanding say-as element of type " + type + ", containing text `"
            + MaryDomUtils.getPlainTextBelow(sayas) + "'");
      }
      ep.match(sayas, type);
    } else {
      // Don't know how to handle type -- ignore
      logger.info("Don't know how to expand say-as type=\"" + type + "\"");
    }
  }
}

代码示例来源:origin: log4j/log4j

/**
 * Log a message object with the <code>TRACE</code> level including the
 * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
 *
 * <p>
 * See {@link #debug(Object)} form for more detailed information.
 * </p>
 *
 * @param message the message object to log.
 * @param t the exception to log, including its stack trace.
 * @since 1.2.12
 */
public void trace(Object message, Throwable t) {
 if (repository.isDisabled(Level.TRACE_INT)) {
  return;
 }
 if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
  forcedLog(FQCN, Level.TRACE, message, t);
 }
}

代码示例来源:origin: marytts/marytts

logger.debug("Have found multiword in dictionary: `" + multiword + "'");
if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  StringBuilder logBuf = new StringBuilder();
  for (Iterator<Element> it = expanded.iterator(); it.hasNext();) {

代码示例来源:origin: marytts/marytts

logger.debug("Have found multiword in dictionary: `" + multiword + "'");
if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  StringBuilder logBuf = new StringBuilder();
  for (Iterator<Element> it = expanded.iterator(); it.hasNext();) {

代码示例来源:origin: marytts/marytts

if (rawmaryxml.getType() != MaryDataType.get("RAWMARYXML"))
  throw new IllegalArgumentException("Expected data of type RAWMARYXML, got " + rawmaryxml.getType());
if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  logger.debug("Now splitting the following RAWMARYXML data into chunks:");
  ByteArrayOutputStream dummy = new ByteArrayOutputStream();

代码示例来源:origin: marytts/marytts

if (writer == null)
  writer = new MaryNormalisedWriter();
if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  ByteArrayOutputStream debugOut = new ByteArrayOutputStream();
  writer.output(xmlDocument, debugOut);

代码示例来源:origin: marytts/marytts

if (writer == null)
  writer = new MaryNormalisedWriter();
if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  ByteArrayOutputStream debugOut = new ByteArrayOutputStream();
  writer.output(xmlDocument, debugOut);

代码示例来源:origin: marytts/marytts

if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  debugLogCandidates(targetUnit, suitableCandidates, suitableF0Candidates);

代码示例来源:origin: marytts/marytts

if (logger.getEffectiveLevel().equals(Level.DEBUG)) {
  debugLogCandidates(targetUnit, suitableCandidates, suitableF0Candidates);

代码示例来源:origin: apache/hbase

log.info("log.info1");
log.error("log.error1");
assertTrue(!Level.ERROR.equals(log.getEffectiveLevel()));
 log.info("log.info2");
 log.error("log.error2");
 assertTrue(Level.ERROR.equals(log.getEffectiveLevel()));
 log.info("log.info3");
 log.error("log.error3");
 assertTrue(Level.DEBUG.equals(log.getEffectiveLevel()));
} finally {
 if (server != null) {

代码示例来源:origin: marytts/marytts

currentData.setOutputParams(outputParams);
if (logger.getEffectiveLevel().equals(Level.DEBUG)
    && (currentData.getType().isTextType() || currentData.getType().isXMLType())) {
  logger.debug("Handing the following data to the next module:");

相关文章