Internal refactoring
This commit is contained in:
@@ -75,18 +75,10 @@ public class LogSource {
|
|||||||
static {
|
static {
|
||||||
|
|
||||||
// Is Log4J Available?
|
// Is Log4J Available?
|
||||||
try {
|
log4jIsAvailable = isClassForName("org.apache.log4j.Logger");
|
||||||
log4jIsAvailable = null != Class.forName("org.apache.log4j.Logger");
|
|
||||||
} catch (final Throwable t) {
|
|
||||||
log4jIsAvailable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is JDK 1.4 Logging Available?
|
// Is JDK 1.4 Logging Available?
|
||||||
try {
|
jdk14IsAvailable = isClassForName("org.apache.commons.logging.impl.Jdk14Logger");
|
||||||
jdk14IsAvailable = null != Class.forName("org.apache.commons.logging.impl.Jdk14Logger");
|
|
||||||
} catch (final Throwable t) {
|
|
||||||
jdk14IsAvailable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the default Log implementation
|
// Set the default Log implementation
|
||||||
String name = null;
|
String name = null;
|
||||||
@@ -159,6 +151,14 @@ public class LogSource {
|
|||||||
return logs.keySet().toArray(EMPTY_STRING_ARRAY);
|
return logs.keySet().toArray(EMPTY_STRING_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isClassForName(final String className) {
|
||||||
|
try {
|
||||||
|
return Class.forName(className) != null;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@link Log} implementation, based on the given <i>name</i>.
|
* Create a new {@link Log} implementation, based on the given <i>name</i>.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
Reference in New Issue
Block a user