1
0

Internal refactoring

This commit is contained in:
Gary Gregory
2023-11-25 12:06:13 -05:00
parent eb9e4c506f
commit 0f16cc12da

View File

@@ -75,18 +75,10 @@ public class LogSource {
static {
// Is Log4J Available?
try {
log4jIsAvailable = null != Class.forName("org.apache.log4j.Logger");
} catch (final Throwable t) {
log4jIsAvailable = false;
}
log4jIsAvailable = isClassForName("org.apache.log4j.Logger");
// Is JDK 1.4 Logging Available?
try {
jdk14IsAvailable = null != Class.forName("org.apache.commons.logging.impl.Jdk14Logger");
} catch (final Throwable t) {
jdk14IsAvailable = false;
}
jdk14IsAvailable = isClassForName("org.apache.commons.logging.impl.Jdk14Logger");
// Set the default Log implementation
String name = null;
@@ -159,6 +151,14 @@ public class LogSource {
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>.
* <p>