1
0

Improve diagnostics

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@394462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Kitching
2006-04-16 11:43:29 +00:00
parent 1c67c2510f
commit 76cc63f74c

View File

@@ -1373,6 +1373,7 @@ public abstract class LogFactory {
Properties props = null;
double priority = 0.0;
URL propsUrl = null;
try {
Enumeration urls = getResources(classLoader, fileName);
@@ -1386,6 +1387,7 @@ public abstract class LogFactory {
Properties newProps = getProperties(url);
if (newProps != null) {
if (props == null) {
propsUrl = url;
props = newProps;
String priorityStr = props.getProperty(PRIORITY_KEY);
priority = 0.0;
@@ -1395,7 +1397,8 @@ public abstract class LogFactory {
if (isDiagnosticsEnabled()) {
logDiagnostic(
"[LOOKUP] First properties file found at '" + url + "'");
"[LOOKUP] Properties file found at '" + url + "'"
+ " with priority " + priority);
}
} else {
String newPriorityStr = newProps.getProperty(PRIORITY_KEY);
@@ -1405,18 +1408,27 @@ public abstract class LogFactory {
}
if (newPriority > priority) {
props = newProps;
priority = newPriority;
if (isDiagnosticsEnabled()) {
if (isDiagnosticsEnabled()) {
logDiagnostic(
"[LOOKUP] New properties file found at '" + url + "'"
+ " has higher priority than earlier file.");
"[LOOKUP] Properties file at '" + url + "'"
+ " with priority " + newPriority
+ " overrides file at '" + propsUrl + "'"
+ " with priority " + priority);
}
}
propsUrl = url;
props = newProps;
priority = newPriority;
} else {
if (isDiagnosticsEnabled()) {
logDiagnostic(
"[LOOKUP] New properties file found at '" + url + "'"
+ " has less priority than earlier file -- ignoring.");
"[LOOKUP] Properties file at '" + url + "'"
+ " with priority " + newPriority
+ " does not override file at '" + propsUrl + "'"
+ " with priority " + priority);
}
}
}