[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-35-gb2b1708

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Sep 21 00:07:55 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  b2b1708d9b714af05cf3903e80406467cd6aa0db (commit)
      from  b1e595bcf4ff91adeab7e8825f6de55818b39993 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=b2b1708d9b714af05cf3903e80406467cd6aa0db
http://github.com/ceki/logback/commit/b2b1708d9b714af05cf3903e80406467cd6aa0db

commit b2b1708d9b714af05cf3903e80406467cd6aa0db
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Sep 21 00:05:50 2011 +0200

    - methods appending to a StringBuffer with names such as printX renamed
    as subjoinX
    - intendation changes

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java b/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
index 1fc4f6b..eedc1e6 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
@@ -254,7 +254,7 @@ public class DBAppender extends DBAppenderBase<ILoggingEvent> {
       throws SQLException {
 
     StringBuilder buf = new StringBuilder();
-    ThrowableProxyUtil.printFirstLine(buf, tp);
+    ThrowableProxyUtil.subjoinFirstLine(buf, tp);
     updateExceptionStatement(insertExceptionStatement, buf.toString(),
         baseIndex++, eventId);
 
@@ -263,7 +263,7 @@ public class DBAppender extends DBAppenderBase<ILoggingEvent> {
     for (int i = 0; i < stepArray.length - commonFrames; i++) {
       StringBuilder sb = new StringBuilder();
       sb.append(CoreConstants.TAB);
-      ThrowableProxyUtil.printSTEP(sb, stepArray[i]);
+      ThrowableProxyUtil.subjoinSTEP(sb, stepArray[i]);
       updateExceptionStatement(insertExceptionStatement, sb.toString(),
           baseIndex++, eventId);
     }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ExtendedThrowableProxyConverter.java b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ExtendedThrowableProxyConverter.java
index 56c43cf..ad6b947 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ExtendedThrowableProxyConverter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ExtendedThrowableProxyConverter.java
@@ -22,7 +22,7 @@ public class ExtendedThrowableProxyConverter extends ThrowableProxyConverter {
   @Override
   protected void extraData(StringBuilder builder, StackTraceElementProxy step) {
     if (step != null) {
-      ThrowableProxyUtil.appendPackagingData(builder, step);
+      ThrowableProxyUtil.subjoinPackagingData(builder, step);
     }
   }
 
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/RootCauseFirstThrowableProxyConverter.java b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/RootCauseFirstThrowableProxyConverter.java
index 3ed88e4..7a98dfd 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/RootCauseFirstThrowableProxyConverter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/RootCauseFirstThrowableProxyConverter.java
@@ -1,6 +1,18 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ *   or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
 package ch.qos.logback.classic.pattern;
 
-import ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter;
 import ch.qos.logback.classic.spi.IThrowableProxy;
 import ch.qos.logback.classic.spi.StackTraceElementProxy;
 import ch.qos.logback.classic.spi.ThrowableProxyUtil;
@@ -12,43 +24,43 @@ import ch.qos.logback.core.CoreConstants;
  */
 public class RootCauseFirstThrowableProxyConverter extends ExtendedThrowableProxyConverter {
 
-    @Override
-    protected String printThrowableToString(IThrowableProxy tp) {
-        StringBuilder buf = new StringBuilder(2048);
-        printRootCauseFirst(tp, buf);
-        return buf.toString();
-    }
+  @Override
+  protected String throwableProxyToString(IThrowableProxy tp) {
+    StringBuilder buf = new StringBuilder(2048);
+    subjoinRootCauseFirst(tp, buf);
+    return buf.toString();
+  }
 
-    private void printRootCauseFirst(IThrowableProxy tp, StringBuilder buf) {
-        if (tp.getCause() != null)
-            printRootCauseFirst(tp.getCause(), buf);
-        printRootCause(tp, buf);
-    }
+  private void subjoinRootCauseFirst(IThrowableProxy tp, StringBuilder buf) {
+    if (tp.getCause() != null)
+      subjoinRootCauseFirst(tp.getCause(), buf);
+    subjoinRootCause(tp, buf);
+  }
 
-    private void printRootCause(IThrowableProxy tp, StringBuilder buf) {
-        ThrowableProxyUtil.printFirstLineRootCauseFirst(buf, tp);
-        buf.append(CoreConstants.LINE_SEPARATOR);
-        StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
-        int commonFrames = tp.getCommonFrames();
+  private void subjoinRootCause(IThrowableProxy tp, StringBuilder buf) {
+    ThrowableProxyUtil.subjoinFirstLineRootCauseFirst(buf, tp);
+    buf.append(CoreConstants.LINE_SEPARATOR);
+    StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
+    int commonFrames = tp.getCommonFrames();
 
-        boolean unrestrictedPrinting = lengthOption > stepArray.length;
-        int length = (unrestrictedPrinting) ? stepArray.length : lengthOption;
+    boolean unrestrictedPrinting = lengthOption > stepArray.length;
+    int length = (unrestrictedPrinting) ? stepArray.length : lengthOption;
 
 
-        int maxIndex = length;
-        if (commonFrames > 0 && unrestrictedPrinting) {
-            maxIndex -= commonFrames;
-        }
-
-        for (int i = 0; i < maxIndex; i++) {
-            String string = stepArray[i].toString();
-            buf.append(CoreConstants.TAB);
-            buf.append(string);
-            extraData(buf, stepArray[i]); // allow other data to be added
-            buf.append(CoreConstants.LINE_SEPARATOR);
-        }
+    int maxIndex = length;
+    if (commonFrames > 0 && unrestrictedPrinting) {
+      maxIndex -= commonFrames;
+    }
 
+    for (int i = 0; i < maxIndex; i++) {
+      String string = stepArray[i].toString();
+      buf.append(CoreConstants.TAB);
+      buf.append(string);
+      extraData(buf, stepArray[i]); // allow other data to be added
+      buf.append(CoreConstants.LINE_SEPARATOR);
     }
 
+  }
+
 
 }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableProxyConverter.java b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableProxyConverter.java
index 3ddb1e5..ba71f6d 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableProxyConverter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableProxyConverter.java
@@ -29,7 +29,7 @@ import ch.qos.logback.core.status.ErrorStatus;
 
 /**
  * Add a stack trace in case the event contains a Throwable.
- * 
+ *
  * @author Ceki G&uuml;lc&uuml;
  */
 public class ThrowableProxyConverter extends ThrowableHandlingConverter {
@@ -72,7 +72,7 @@ public class ThrowableProxyConverter extends ThrowableHandlingConverter {
         Context context = getContext();
         Map evaluatorMap = (Map) context.getObject(CoreConstants.EVALUATOR_MAP);
         EventEvaluator<ILoggingEvent> ee = (EventEvaluator<ILoggingEvent>) evaluatorMap
-            .get(evaluatorStr);
+                .get(evaluatorStr);
         addEvaluator(ee);
       }
     }
@@ -116,14 +116,14 @@ public class ThrowableProxyConverter extends ThrowableHandlingConverter {
           errorCount++;
           if (errorCount < CoreConstants.MAX_ERROR_COUNT) {
             addError("Exception thrown for evaluator named [" + ee.getName()
-                + "]", eex);
+                    + "]", eex);
           } else if (errorCount == CoreConstants.MAX_ERROR_COUNT) {
             ErrorStatus errorStatus = new ErrorStatus(
-                "Exception thrown for evaluator named [" + ee.getName() + "].",
-                this, eex);
+                    "Exception thrown for evaluator named [" + ee.getName() + "].",
+                    this, eex);
             errorStatus.add(new ErrorStatus(
-                "This was the last warning about this evaluator's errors."
-                    + "We don't want the StatusManager to get flooded.", this));
+                    "This was the last warning about this evaluator's errors."
+                            + "We don't want the StatusManager to get flooded.", this));
             addStatus(errorStatus);
           }
         }
@@ -134,21 +134,21 @@ public class ThrowableProxyConverter extends ThrowableHandlingConverter {
       }
     }
 
-    return printThrowableToString(tp);
-    }
+    return throwableProxyToString(tp);
+  }
 
-  protected String printThrowableToString(IThrowableProxy tp) {
-      StringBuilder buf = new StringBuilder(32);
-      IThrowableProxy currentThrowable = tp;
-      while (currentThrowable != null) {
-          printThrowableProxy(buf, currentThrowable);
-          currentThrowable = currentThrowable.getCause();
-      }
+  protected String throwableProxyToString(IThrowableProxy tp) {
+    StringBuilder buf = new StringBuilder(32);
+    IThrowableProxy currentThrowable = tp;
+    while (currentThrowable != null) {
+      subjoinThrowableProxy(buf, currentThrowable);
+      currentThrowable = currentThrowable.getCause();
+    }
     return buf.toString();
   }
 
-  void printThrowableProxy(StringBuilder buf, IThrowableProxy tp) {
-    ThrowableProxyUtil.printFirstLine(buf, tp);
+  void subjoinThrowableProxy(StringBuilder buf, IThrowableProxy tp) {
+    ThrowableProxyUtil.subjoinFirstLine(buf, tp);
     buf.append(CoreConstants.LINE_SEPARATOR);
     StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
     int commonFrames = tp.getCommonFrames();
@@ -172,7 +172,7 @@ public class ThrowableProxyConverter extends ThrowableHandlingConverter {
 
     if (commonFrames > 0 && unrestrictedPrinting) {
       buf.append("\t... ").append(tp.getCommonFrames()).append(
-          " common frames omitted").append(CoreConstants.LINE_SEPARATOR);
+              " common frames omitted").append(CoreConstants.LINE_SEPARATOR);
     }
   }
 }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxy.java b/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxy.java
index 303ed6e..7476b57 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxy.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxy.java
@@ -108,7 +108,7 @@ public class ThrowableProxy implements IThrowableProxy {
     for (StackTraceElementProxy step : stackTraceElementProxyArray) {
       String string = step.toString();
       builder.append(CoreConstants.TAB).append(string);
-      ThrowableProxyUtil.appendPackagingData(builder, step);
+      ThrowableProxyUtil.subjoinPackagingData(builder, step);
       builder.append(CoreConstants.LINE_SEPARATOR);
     }
     System.out.println(builder.toString());
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxyUtil.java b/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxyUtil.java
index 1283bce..8d76786 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxyUtil.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/spi/ThrowableProxyUtil.java
@@ -76,15 +76,15 @@ public class ThrowableProxyUtil {
     StringBuilder sb = new StringBuilder();
 
     while (tp != null) {
-      printFirstLine(sb, tp);
+      subjoinFirstLine(sb, tp);
       sb.append(CoreConstants.LINE_SEPARATOR);
-      printSTEPArray(sb, tp);
+      subjoinSTEPArray(sb, tp);
       tp = tp.getCause();
     }
     return sb.toString();
   }
 
-  public static void appendPackagingData(StringBuilder builder, StackTraceElementProxy step) {
+  public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) {
     if (step != null) {
       ClassPackagingData cpd = step.getClassPackagingData();
       if (cpd != null) {
@@ -100,19 +100,19 @@ public class ThrowableProxyUtil {
     }
   }
   
-  static public void printSTEP(StringBuilder sb, StackTraceElementProxy step) {
+  static public void subjoinSTEP(StringBuilder sb, StackTraceElementProxy step) {
     sb.append(step.toString());
-    appendPackagingData(sb, step);
+    subjoinPackagingData(sb, step);
   }
   
-  static public void printSTEPArray(StringBuilder sb, IThrowableProxy tp) {
+  static public void subjoinSTEPArray(StringBuilder sb, IThrowableProxy tp) {
     StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
     int commonFrames = tp.getCommonFrames();
 
     for (int i = 0; i < stepArray.length - commonFrames; i++) {
       StackTraceElementProxy step = stepArray[i];
       sb.append(CoreConstants.TAB);
-      printSTEP(sb, step);
+      subjoinSTEP(sb, step);
       sb.append(CoreConstants.LINE_SEPARATOR);
     }
     
@@ -123,22 +123,22 @@ public class ThrowableProxyUtil {
     
   }
 
-  static public void printFirstLine(StringBuilder buf, IThrowableProxy tp) {
+  static public void subjoinFirstLine(StringBuilder buf, IThrowableProxy tp) {
     int commonFrames = tp.getCommonFrames();
     if (commonFrames > 0) {
       buf.append(CoreConstants.CAUSED_BY);
     }
-    printExceptionMessage(buf, tp);
+    subjoinExceptionMessage(buf, tp);
   }
 
-  static public void printFirstLineRootCauseFirst(StringBuilder buf, IThrowableProxy tp) {
+  static public void subjoinFirstLineRootCauseFirst(StringBuilder buf, IThrowableProxy tp) {
     if (tp.getCause() != null) {
       buf.append(CoreConstants.WRAPPED_BY);
     }
-    printExceptionMessage(buf, tp);
+    subjoinExceptionMessage(buf, tp);
   }
 
-  private static void printExceptionMessage(StringBuilder buf, IThrowableProxy tp) {
+  private static void subjoinExceptionMessage(StringBuilder buf, IThrowableProxy tp) {
     buf.append(tp.getClassName()).append(": ").append(tp.getMessage());
   }
 }

-----------------------------------------------------------------------

Summary of changes:
 .../java/ch/qos/logback/classic/db/DBAppender.java |    4 +-
 .../pattern/ExtendedThrowableProxyConverter.java   |    2 +-
 .../RootCauseFirstThrowableProxyConverter.java     |   74 +++++++++++--------
 .../classic/pattern/ThrowableProxyConverter.java   |   38 +++++-----
 .../ch/qos/logback/classic/spi/ThrowableProxy.java |    2 +-
 .../logback/classic/spi/ThrowableProxyUtil.java    |   24 +++---
 6 files changed, 78 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list