logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r956461 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java
Date Mon, 21 Jun 2010 06:47:32 GMT
Author: sdeboy
Date: Mon Jun 21 05:40:14 2010
New Revision: 956461

URL: http://svn.apache.org/viewvc?rev=956461&view=rev
Log:
When an html file containing a default layout (included in the distribution) is displayed
in the detail layout editor, pull the Apache header off of the layout in the editor pane.

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java?rev=956461&r1=956460&r2=956461&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/DefaultLayoutFactory.java
Mon Jun 21 05:40:14 2010
@@ -73,8 +73,17 @@ public class DefaultLayoutFactory {
         } catch (Exception e) {
           content = new StringBuffer(PatternLayout.TTCC_CONVERSION_PATTERN);
         }
-
-        defaultPatternLayout = content.toString();
+        String trimmedContent = content.toString().trim();
+        //the default docs contain the apache license header, strip that out before displaying
+        String startComment = "<!--";
+        String endComment = "-->";
+        if (trimmedContent.startsWith(startComment)) {
+            int endIndex = trimmedContent.indexOf(endComment);
+            if (endIndex > -1) {
+                trimmedContent = trimmedContent.substring(endIndex + endComment.length()).trim();
+            }
+        }
+        defaultPatternLayout = trimmedContent;
       }
 
     return defaultPatternLayout;



Mime
View raw message