org.apache.commons.logging.LogFactory.getInstance()方法的使用及代码示例

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

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

LogFactory.getInstance介绍

[英]Convenience method to derive a name from the specified class and call getInstance(String) with it.
[中]从指定类派生名称并使用该名称调用getInstance(String)的便利方法。

代码示例

代码示例来源:origin: org.apache.poi/poi

@Override
public void initialize(final String cat)
{
  this.log = _creator.getInstance(cat);
}

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

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return getFactory().getInstance(clazz);
}

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

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param name Logical name of the <code>Log</code> instance to be
 *  returned (the meaning of this name is only known to the underlying
 *  logging implementation that is being wrapped)
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(String name) throws LogConfigurationException {
  return getFactory().getInstance(name);
}

代码示例来源:origin: org.slf4j/jcl-over-slf4j

/**
 * Convenience method to return a named logger, without the application having
 * to care about factories.
 * 
 * @param clazz
 *                Class from which a log name will be derived
 * 
 * @exception LogConfigurationException
 *                    if a suitable <code>Log</code> instance cannot be
 *                    returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return (getFactory().getInstance(clazz));
}

代码示例来源:origin: org.slf4j/jcl-over-slf4j

/**
 * Convenience method to return a named logger, without the application having
 * to care about factories.
 * 
 * @param name
 *                Logical name of the <code>Log</code> instance to be
 *                returned (the meaning of this name is only known to the
 *                underlying logging implementation that is being wrapped)
 * 
 * @exception LogConfigurationException
 *                    if a suitable <code>Log</code> instance cannot be
 *                    returned
 */
public static Log getLog(String name) throws LogConfigurationException {
  return (getFactory().getInstance(name));
}

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

/**
 * Convenience method to return a named logger, without the application having
 * to care about factories.
 * 
 * @param clazz
 *                Class from which a log name will be derived
 * 
 * @exception LogConfigurationException
 *                    if a suitable <code>Log</code> instance cannot be
 *                    returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return (getFactory().getInstance(clazz));
}

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

/**
 * Convenience method to return a named logger, without the application having
 * to care about factories.
 * 
 * @param name
 *                Logical name of the <code>Log</code> instance to be
 *                returned (the meaning of this name is only known to the
 *                underlying logging implementation that is being wrapped)
 * 
 * @exception LogConfigurationException
 *                    if a suitable <code>Log</code> instance cannot be
 *                    returned
 */
public static Log getLog(String name) throws LogConfigurationException {
  return (getFactory().getInstance(name));
}

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

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 *
 * @exception LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(Class clazz)
  throws LogConfigurationException {
  return (getFactory().getInstance(clazz));
}

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

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param name Logical name of the <code>Log</code> instance to be
 *  returned (the meaning of this name is only known to the underlying
 *  logging implementation that is being wrapped)
 *
 * @exception LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(String name)
  throws LogConfigurationException {
  return (getFactory().getInstance(name));
}

代码示例来源:origin: org.openmicroscopy/ome-poi

public void initialize(final String cat)
{
  this.log = _creator.getInstance(cat);
}

代码示例来源:origin: org.mule.modules/mule-module-logging

/**
 * Convenience method to return a named logger, without the application having
 * to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 * @throws LogConfigurationException if a suitable <code>Log</code> instance cannot be
 *                                   returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException
{
  return (getFactory().getInstance(clazz));
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return getFactory().getInstance(clazz);
}

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

@Override
 public Log getLog(String s) {
  return new CommonsLogger(cl.getInstance(s));
 }
};

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

/**
 * This method MUST not invoke any logging..
 *
 * @param clazz The class the log has to be created for
 * @return The input class logger
 */
public static Log _newLog(Class<?> clazz) {
  classRegistry.put(clazz, clazz);
  return (logFactory == null)
      ? new SimpleLog(clazz.getName())
      : logFactory.getInstance(clazz.getName());
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return getFactory().getInstance(clazz);
}

代码示例来源:origin: org.kopitubruk.util/JSONUtil

/**
 * Make sure that the logger is there.
 */
private static synchronized void ensureLogger()
{
  if ( log == null ){
    logFactory = LogFactory.getFactory();
    log = logFactory.getInstance(JSONConfigDefaults.class);
  }
}

代码示例来源:origin: Nextdoor/bender

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *  instance cannot be returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return getFactory().getInstance(clazz);
}

代码示例来源:origin: org.cache2k/cache2k-impl

@Override
 public Log getLog(String s) {
  return new CommonsLogger(cl.getInstance(s));
 }
};

代码示例来源:origin: org.jboss.logmanager/commons-logging-jboss-logmanager

/**
 * Convenience method to return a named logger, without the application
 * having to care about factories.
 *
 * @param clazz Class from which a log name will be derived
 *
 * @throws LogConfigurationException if a suitable <code>Log</code>
 *                                   instance cannot be returned
 */
public static Log getLog(Class clazz) throws LogConfigurationException {
  return getFactory().getInstance(clazz);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel

public void setLogFactory(LogFactory logFactory) {
  // change the log factory
  GeronimoLogFactory.logFactory = logFactory;
  // update all known logs to use instances of the new factory
  Set logs = getInstances();
  for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
    GeronimoLog log = (GeronimoLog) iterator.next();
    log.setLog(logFactory.getInstance(log.getName()));
  }
}

相关文章