本文整理了Java中org.apache.commons.logging.LogFactory.getInstance()
方法的一些代码示例,展示了LogFactory.getInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogFactory.getInstance()
方法的具体详情如下:
包路径:org.apache.commons.logging.LogFactory
类名称: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()));
}
}
内容来源于网络,如有侵权,请联系作者删除!