[LOGBack-dev] svn commit: r273 - logback/core/trunk/src/main/java/ch/qos/logback/core/status
noreply.seb at qos.ch
noreply.seb at qos.ch
Tue Jul 25 14:34:06 CEST 2006
Author: seb
Date: Tue Jul 25 14:34:05 2006
New Revision: 273
Modified:
logback/core/trunk/src/main/java/ch/qos/logback/core/status/StatusBase.java
Log:
added implementation of getEffectiveLevel
Modified: logback/core/trunk/src/main/java/ch/qos/logback/core/status/StatusBase.java
==============================================================================
--- logback/core/trunk/src/main/java/ch/qos/logback/core/status/StatusBase.java (original)
+++ logback/core/trunk/src/main/java/ch/qos/logback/core/status/StatusBase.java Tue Jul 25 14:34:05 2006
@@ -20,7 +20,7 @@
int level;
final String message;
final Object origin;
- List childrenList;
+ List<Status> childrenList;
Throwable throwable;
@@ -41,7 +41,7 @@
"Null values are not valid Status.");
}
if (childrenList == null) {
- childrenList = new ArrayList();
+ childrenList = new ArrayList<Status>();
}
childrenList.add(child);
}
@@ -72,6 +72,23 @@
public int getLevel() {
return level;
}
+
+ public int getEffectiveLevel() {
+ int result = level;
+ int effLevel;
+
+ Iterator it = iterator();
+ Status s;
+ while(it.hasNext()) {
+ s = (Status)it.next();
+ effLevel = s.getEffectiveLevel();
+ if (effLevel > result) {
+ result = effLevel;
+ }
+ }
+
+ return result;
+ }
public String getMessage() {
return message;
More information about the logback-dev
mailing list