[logback-dev] svn commit: r2138 - logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util

noreply.ceki at qos.ch noreply.ceki at qos.ch
Mon Feb 2 23:40:27 CET 2009


Author: ceki
Date: Mon Feb  2 23:40:27 2009
New Revision: 2138

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java

Log:
- printInCaseOfErrorsOrWarnings should print ERRORS not just WARNings


Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java	Mon Feb  2 23:40:27 2009
@@ -50,7 +50,7 @@
       ps.println("WARN: Context named \"" + context.getName()
           + "\" has no status manager");
     } else {
-      if (sm.getLevel() == ErrorStatus.WARN) {
+      if (sm.getLevel() == ErrorStatus.WARN || (sm.getLevel() == ErrorStatus.ERROR) ) {
         print(sm);
       }
     }
@@ -112,9 +112,9 @@
   
 
   private static void buildStrFromStatusList(StringBuilder sb, List<Status> statusList) {
-    Iterator it = statusList.iterator();
-    while (it.hasNext()) {
-      Status s = (Status) it.next();
+    if(statusList == null)
+      return;
+    for(Status s : statusList) {
       buildStr(sb, "", s);
     }
   }


More information about the logback-dev mailing list