logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1516691 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
Date Fri, 23 Aug 2013 04:04:11 GMT
Author: ggregory
Date: Fri Aug 23 04:04:10 2013
New Revision: 1516691

URL: http://svn.apache.org/r1516691
Log:
Implement toString() for debugging.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java?rev=1516691&r1=1516690&r2=1516691&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
Fri Aug 23 04:04:10 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.logging.log4j.core.pattern;
 
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.logging.log4j.core.LogEvent;
@@ -88,4 +89,22 @@ public final class StyleConverter extend
             toAppendTo.append(style).append(buf.toString()).append(AnsiEscape.getDefaultStyle());
         }
     }
+    
+    /**
+     * Returns a String suitable for debugging.
+     * 
+     * @return a String suitable for debugging.
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(super.toString());
+        sb.append("[style=");
+        sb.append(style);
+        sb.append(", patternFormatters=");
+        sb.append(patternFormatters);
+        sb.append("]");
+        return sb.toString();
+    }
+
 }



Mime
View raw message