logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1514548 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: helpers/Transform.java layout/HTMLLayout.java layout/XMLLayout.java
Date Fri, 16 Aug 2013 00:53:16 GMT
Author: ggregory
Date: Fri Aug 16 00:53:15 2013
New Revision: 1514548

URL: http://svn.apache.org/r1514548
Log:
Rename escapeTags to escapeHtmlTags

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java?rev=1514548&r1=1514547&r2=1514548&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
Fri Aug 16 00:53:15 2013
@@ -40,7 +40,7 @@ public final class Transform {
      * @param input The text to be converted.
      * @return The input string with the special characters replaced.
      */
-    public static String escapeTags(final String input) {
+    public static String escapeHtmlTags(final String input) {
         //Check if the string is null, zero length or devoid of special characters
         // if so, return what was sent in.
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java?rev=1514548&r1=1514547&r2=1514548&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
Fri Aug 16 00:53:15 2013
@@ -125,7 +125,7 @@ public final class HTMLLayout extends Ab
         sbuf.append(event.getMillis() - jvmStartTime);
         sbuf.append("</td>").append(Constants.LINE_SEP);
 
-        final String escapedThread = Transform.escapeTags(event.getThreadName());
+        final String escapedThread = Transform.escapeHtmlTags(event.getThreadName());
         sbuf.append("<td title=\"").append(escapedThread).append(" thread\">");
         sbuf.append(escapedThread);
         sbuf.append("</td>").append(Constants.LINE_SEP);
@@ -133,18 +133,18 @@ public final class HTMLLayout extends Ab
         sbuf.append("<td title=\"Level\">");
         if (event.getLevel().equals(Level.DEBUG)) {
             sbuf.append("<font color=\"#339933\">");
-            sbuf.append(Transform.escapeTags(String.valueOf(event.getLevel())));
+            sbuf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
             sbuf.append("</font>");
         } else if (event.getLevel().isAtLeastAsSpecificAs(Level.WARN)) {
             sbuf.append("<font color=\"#993300\"><strong>");
-            sbuf.append(Transform.escapeTags(String.valueOf(event.getLevel())));
+            sbuf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
             sbuf.append("</strong></font>");
         } else {
-            sbuf.append(Transform.escapeTags(String.valueOf(event.getLevel())));
+            sbuf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
         }
         sbuf.append("</td>").append(Constants.LINE_SEP);
 
-        String escapedLogger = Transform.escapeTags(event.getLoggerName());
+        String escapedLogger = Transform.escapeHtmlTags(event.getLoggerName());
         if (escapedLogger.isEmpty()) {
             escapedLogger = "root";
         }
@@ -155,14 +155,14 @@ public final class HTMLLayout extends Ab
         if (locationInfo) {
             final StackTraceElement element = event.getSource();
             sbuf.append("<td>");
-            sbuf.append(Transform.escapeTags(element.getFileName()));
+            sbuf.append(Transform.escapeHtmlTags(element.getFileName()));
             sbuf.append(':');
             sbuf.append(element.getLineNumber());
             sbuf.append("</td>").append(Constants.LINE_SEP);
         }
 
         sbuf.append("<td title=\"Message\">");
-        sbuf.append(Transform.escapeTags(event.getMessage().getFormattedMessage()).replaceAll(REGEXP,
"<br />"));
+        sbuf.append(Transform.escapeHtmlTags(event.getMessage().getFormattedMessage()).replaceAll(REGEXP,
"<br />"));
         sbuf.append("</td>").append(Constants.LINE_SEP);
         sbuf.append("</tr>").append(Constants.LINE_SEP);
 
@@ -170,7 +170,7 @@ public final class HTMLLayout extends Ab
             sbuf.append("<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : ").append(fontSize);
             sbuf.append(";\" colspan=\"6\" ");
             sbuf.append("title=\"Nested Diagnostic Context\">");
-            sbuf.append("NDC: ").append(Transform.escapeTags(event.getContextStack().toString()));
+            sbuf.append("NDC: ").append(Transform.escapeHtmlTags(event.getContextStack().toString()));
             sbuf.append("</td></tr>").append(Constants.LINE_SEP);
         }
 
@@ -178,7 +178,7 @@ public final class HTMLLayout extends Ab
             sbuf.append("<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : ").append(fontSize);
             sbuf.append(";\" colspan=\"6\" ");
             sbuf.append("title=\"Mapped Diagnostic Context\">");
-            sbuf.append("MDC: ").append(Transform.escapeTags(event.getContextMap().toString()));
+            sbuf.append("MDC: ").append(Transform.escapeHtmlTags(event.getContextMap().toString()));
             sbuf.append("</td></tr>").append(Constants.LINE_SEP);
         }
 
@@ -241,7 +241,7 @@ public final class HTMLLayout extends Ab
             } else {
                 first = false;
             }
-            sbuf.append(Transform.escapeTags(line));
+            sbuf.append(Transform.escapeHtmlTags(line));
             sbuf.append(Constants.LINE_SEP);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java?rev=1514548&r1=1514547&r2=1514548&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
Fri Aug 16 00:53:15 2013
@@ -140,13 +140,13 @@ public class XMLLayout extends AbstractS
         if (name.isEmpty()) {
             name = "root";
         }
-        buf.append(Transform.escapeTags(name));
+        buf.append(Transform.escapeHtmlTags(name));
         buf.append("\" timestamp=\"");
         buf.append(event.getMillis());
         buf.append("\" level=\"");
-        buf.append(Transform.escapeTags(String.valueOf(event.getLevel())));
+        buf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
         buf.append("\" thread=\"");
-        buf.append(Transform.escapeTags(event.getThreadName()));
+        buf.append(Transform.escapeHtmlTags(event.getThreadName()));
         buf.append("\">");
         buf.append(this.eol);
 
@@ -230,11 +230,11 @@ public class XMLLayout extends AbstractS
                 buf.append(this.namespacePrefix);
             }
             buf.append("LocationInfo class=\"");
-            buf.append(Transform.escapeTags(element.getClassName()));
+            buf.append(Transform.escapeHtmlTags(element.getClassName()));
             buf.append("\" method=\"");
-            buf.append(Transform.escapeTags(element.getMethodName()));
+            buf.append(Transform.escapeHtmlTags(element.getMethodName()));
             buf.append("\" file=\"");
-            buf.append(Transform.escapeTags(element.getFileName()));
+            buf.append(Transform.escapeHtmlTags(element.getFileName()));
             buf.append("\" line=\"");
             buf.append(element.getLineNumber());
             buf.append("\"/>");
@@ -256,9 +256,9 @@ public class XMLLayout extends AbstractS
                     buf.append(this.namespacePrefix);
                 }
                 buf.append("Data name=\"");
-                buf.append(Transform.escapeTags(entry.getKey()));
+                buf.append(Transform.escapeHtmlTags(entry.getKey()));
                 buf.append("\" value=\"");
-                buf.append(Transform.escapeTags(String.valueOf(entry.getValue())));
+                buf.append(Transform.escapeHtmlTags(String.valueOf(entry.getValue())));
                 buf.append("\"/>");
                 buf.append(this.eol);
             }



Mime
View raw message