[logback-dev] svn commit: r980 - in logback/trunk: logback-classic/src/main/java/ch/qos/logback/classic/pattern logback-core/src/main/java/ch/qos/logback/core/status

noreply.seb at qos.ch noreply.seb at qos.ch
Wed Nov 22 10:00:28 CET 2006


Author: seb
Date: Wed Nov 22 10:00:28 2006
New Revision: 980

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ClassNameAbbreviator.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/Status.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/StatusBase.java

Log:
Statuses now have a creation date
ClassNameAbbreviator.java now has a public constructor

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ClassNameAbbreviator.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ClassNameAbbreviator.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ClassNameAbbreviator.java	Wed Nov 22 10:00:28 2006
@@ -19,7 +19,7 @@
   final int targetLength;
   StringBuffer buf;
 
-  ClassNameAbbreviator(int targetLength) {
+  public ClassNameAbbreviator(int targetLength) {
     this.targetLength = targetLength;
     buf = new StringBuffer(targetLength);
   }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/Status.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/Status.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/status/Status.java	Wed Nov 22 10:00:28 2006
@@ -23,6 +23,7 @@
   Object getOrigin();
   String getMessage();
   Throwable getThrowable();
+  Long getDate();
   
   public boolean hasChildren();
   public void add(Status child);

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 10:00:28 2006
@@ -22,6 +22,7 @@
   final Object origin;
   List<Status> childrenList;
   Throwable throwable;
+  long date;
 
   StatusBase(int level, String msg, Object origin) {
     this(level, msg, origin, null);
@@ -32,6 +33,7 @@
     this.message = msg;
     this.origin = origin;
     this.throwable = t;
+    this.date = System.currentTimeMillis();
   }
 
   public synchronized void add(Status child) {
@@ -98,12 +100,17 @@
   public Throwable getThrowable() {
     return throwable;
   }
+  
+  public Long getDate() {
+    return date;
+  }
 
   /**
    * @Override
    */
   public String toString() {
     StringBuffer buf = new StringBuffer();
+    buf.append(date + " ");
     switch (getEffectiveLevel()) {
     case INFO:
       buf.append("INFO");



More information about the logback-dev mailing list