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

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

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

Logger.warn介绍

[英]Log a warn priority event.
[中]记录警告优先级事件。

代码示例

代码示例来源:origin: org.freemarker/freemarker

@Override
public void warn(String message) {
  logger.warn(message);
}

代码示例来源:origin: org.freemarker/freemarker

@Override
public void warn(String message, Throwable t) {
  logger.warn(message, t);
}

代码示例来源:origin: commons-logging/commons-logging

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 *
 * @param message to log
 * @param t log this cause
 * @see org.apache.commons.logging.Log#warn(Object, Throwable)
 */
public void warn(Object message, Throwable t) {
  if (message != null) {
    getLogger().warn(String.valueOf(message), t);
  }
}

代码示例来源:origin: commons-logging/commons-logging

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 *
 * @param message to log
 * @see org.apache.commons.logging.Log#warn(Object)
 */
public void warn(Object message) {
  if (message != null) {
    getLogger().warn(String.valueOf(message));
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 * 
 * @param message to log
 * @see org.apache.commons.logging.Log#warn(Object)
 */
public void warn(Object message) {
  if (message != null) {
    getLogger().warn(String.valueOf(message));
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 * 
 * @param message to log
 * @param t log this cause
 * @see org.apache.commons.logging.Log#warn(Object, Throwable)
 */
public void warn(Object message, Throwable t) {
  if (message != null) {
    getLogger().warn(String.valueOf(message), t);
  }
}

代码示例来源:origin: org.apache.avalon.framework/avalon-framework-impl

/**
 * Log a warn message.
 *
 * @param message the message
 */
public final void warn( final String message )
{
  m_logger.warn( message );
}

代码示例来源:origin: org.apache.avalon.framework/avalon-framework-impl

/**
 * Log a warn message.
 *
 * @param message the message
 * @param throwable the throwable
 */
public final void warn( final String message, final Throwable throwable )
{
  m_logger.warn( message, throwable );
}

代码示例来源:origin: undera/jmeter-plugins

private void close(ResultSet r) {
  if (r != null) {
    try {
      r.close();
    } catch (SQLException ex) {
      log.warn("Failed to close resultset", ex);
    }
  }
}

代码示例来源:origin: undera/jmeter-plugins

private void close(Statement r) {
  if (r != null) {
    try {
      r.close();
    } catch (SQLException ex) {
      log.warn("Failed to close statement", ex);
    }
  }
}

代码示例来源:origin: undera/jmeter-plugins

@Override
public boolean interrupt() {
  if (savedSock != null && savedSock.isOpen()) {
    try {
      savedSock.close();
    } catch (IOException ex) {
      log.warn("Exception while interrupting channel: ", ex);
      return false;
    }
  }
  return true;
}

代码示例来源:origin: apache/activemq-artemis

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 *
 * @param message to log
 * @param t log this cause
 * @see org.apache.activemq.artemis.shaded.org.apache.commons.logging.Log#warn(Object, Throwable)
 */
public void warn(Object message, Throwable t) {
  if (message != null) {
    getLogger().warn(String.valueOf(message), t);
  }
}

代码示例来源:origin: apache/activemq-artemis

/**
 * Logs a message with <code>org.apache.log.Priority.WARN</code>.
 *
 * @param message to log
 * @see org.apache.activemq.artemis.shaded.org.apache.commons.logging.Log#warn(Object)
 */
public void warn(Object message) {
  if (message != null) {
    getLogger().warn(String.valueOf(message));
  }
}

代码示例来源:origin: undera/jmeter-plugins

private void appendSampleVariable(ByteBuffer buf, SampleEvent evt, int varID) {
  if (SampleEvent.getVarCount() < varID + 1) {
    buf.put(("UNDEFINED_variable#" + varID).getBytes());
    log.warn("variable#" + varID + " does not exist!");
  } else {
    if (evt.getVarValue(varID) != null) {
      buf.put(evt.getVarValue(varID).getBytes());
    }
  }
}

代码示例来源:origin: undera/jmeter-plugins

public CollectionProperty getSamplerSettings() {
  JMeterProperty prop = getProperty(DATA_PROPERTY);
  if (!(prop instanceof CollectionProperty)) {
    log.warn("Got unexpected property: " + prop);
    return new CollectionProperty(); // empty collection instead of NullProperty
  }
  CollectionProperty rows = (CollectionProperty) prop;
  return rows;
}

代码示例来源:origin: kg.apc/jmeter-plugins-standard

public CollectionProperty getData() {
  JMeterProperty prop = getProperty(WEIGHTS);
  // log.info("Weights prop: " + prop);
  if (prop instanceof CollectionProperty) {
    return (CollectionProperty) prop;
  } else {
    log.warn("Returning empty collection");
    return new CollectionProperty();
  }
}

代码示例来源:origin: undera/jmeter-plugins

@Override
public void configure(TestElement te) {
  super.configure(te);
  DbMonCollector dmte = (DbMonCollector) te;
  JMeterProperty dbmonValues = dmte.getSamplerSettings();
  if (!(dbmonValues instanceof NullProperty)) {
    JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) dbmonValues, tableModel, columnClasses);
  } else {
    log.warn("Received null property instead of collection");
  }
}

代码示例来源:origin: undera/jmeter-plugins

@Override
public void configure(TestElement te) {
  super.configure(te);
  JMXMonCollector dmte = (JMXMonCollector) te;
  JMeterProperty jmxmonValues = dmte.getSamplerSettings();
  if (!(jmxmonValues instanceof NullProperty)) {
    JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) jmxmonValues, tableModel, columnClasses);
  } else {
    log.warn("Received null property instead of collection");
  }
}

代码示例来源:origin: undera/jmeter-plugins

@Override
public void configure(TestElement te) {
  super.configure(te);
  PerfMonCollector pmte = (PerfMonCollector) te;
  JMeterProperty perfmonValues = pmte.getMetricSettings();
  if (!(perfmonValues instanceof NullProperty)) {
    JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) perfmonValues, tableModel);
  } else {
    log.warn("Received null property instead of collection");
  }
}

代码示例来源:origin: undera/jmeter-plugins

@Override
public void configure(TestElement te) {
  super.configure(te);
  MonitoringResultsCollector mrc = (MonitoringResultsCollector) te;
  JMeterProperty samplerValues = mrc.getSamplerSettings();
  if (!(samplerValues instanceof NullProperty)) {
    JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) samplerValues, tableModel, getColumnClasses());
  } else {
    log.warn("Received null property instead of collection");
  }
}

相关文章