[logback-dev] svn commit: r986 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/status test/java/ch/qos/logback/core/util

noreply.seb at qos.ch noreply.seb at qos.ch
Wed Nov 22 20:05:23 CET 2006


Author: seb
Date: Wed Nov 22 20:05:22 2006
New Revision: 986

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/StatusBase.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/StatusPrinterTest.java

Log:
Vemoved date from toString() method
Verified that exceptions print correctly

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/StatusBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/StatusBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/StatusBase.java	Wed Nov 22 20:05:22 2006
@@ -110,7 +110,6 @@
    */
   public String toString() {
     StringBuffer buf = new StringBuffer();
-    buf.append(date + " ");
     switch (getEffectiveLevel()) {
     case INFO:
       buf.append("INFO");

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/StatusPrinterTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/StatusPrinterTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/StatusPrinterTest.java	Wed Nov 22 20:05:22 2006
@@ -53,4 +53,28 @@
     StatusPrinter.print(context);
   }
   
+  public void testWithException() {
+    Status s0 = new ErrorStatus("test0", this);
+    Status s1 = new InfoStatus("test1", this, new Exception("testEx"));
+    Status s11 = new InfoStatus("test11", this);
+    Status s12 = new InfoStatus("test12", this);
+    s1.add(s11);
+    s1.add(s12);
+    
+    Status s2 = new InfoStatus("test2", this);
+    Status s21 = new InfoStatus("test21", this);
+    Status s211 = new WarnStatus("test211", this);
+    
+    Status s22 = new InfoStatus("test22", this);
+    s2.add(s21);
+    s2.add(s22);
+    s21.add(s211);
+    
+    Context context = new ContextBase();
+    context.getStatusManager().add(s0);
+    context.getStatusManager().add(s1);
+    context.getStatusManager().add(s2);
+    StatusPrinter.print(context);    
+  }
+  
 }



More information about the logback-dev mailing list