LogFactory provides getFactory() with getInstance methods as well
Issue: SPR-14512
This commit is contained in:
parent
47277f43da
commit
45e7b350bd
|
@ -98,6 +98,40 @@ public abstract class LogFactory {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method only exists for compatibility with unusual Commons Logging API
|
||||
* usage like e.g. {@code LogFactory.getFactory().getInstance(Class/String)}.
|
||||
* @see #getInstance(Class)
|
||||
* @see #getInstance(String)
|
||||
* @deprecated in favor of {@link #getLog(Class)}/{@link #getLog(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static LogFactory getFactory() {
|
||||
return new LogFactory() {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to return a named logger.
|
||||
* <p>This variant just dispatches straight to {@link #getLog(Class)}.
|
||||
* @param clazz containing Class from which a log name will be derived
|
||||
* @deprecated in favor of {@link #getLog(Class)}
|
||||
*/
|
||||
@Deprecated
|
||||
public Log getInstance(Class<?> clazz) {
|
||||
return getLog(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to return a named logger.
|
||||
* <p>This variant just dispatches straight to {@link #getLog(String)}.
|
||||
* @param name logical name of the <code>Log</code> instance to be returned
|
||||
* @deprecated in favor of {@link #getLog(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public Log getInstance(String name) {
|
||||
return getLog(name);
|
||||
}
|
||||
|
||||
|
||||
private enum LogApi {LOG4J, SLF4J, JUL}
|
||||
|
||||
|
|
Loading…
Reference in New Issue