[logback-dev] svn commit: r1510 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern
noreply.ceki at qos.ch
noreply.ceki at qos.ch
Sat Apr 21 22:36:17 CEST 2007
Author: ceki
Date: Sat Apr 21 22:36:17 2007
New Revision: 1510
Modified:
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/MarkerConverter.java
Log:
aliging with the implementation of toString in BasicMarker (in SLF4J)
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/MarkerConverter.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/MarkerConverter.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/MarkerConverter.java Sat Apr 21 22:36:17 2007
@@ -1,7 +1,5 @@
package ch.qos.logback.classic.pattern;
-import java.util.Iterator;
-
import org.slf4j.Marker;
import ch.qos.logback.classic.spi.LoggingEvent;
@@ -12,36 +10,16 @@
* @author Sébastien Pennec
*/
public class MarkerConverter extends ClassicConverter {
-
+
private static String EMPTY = "";
- private static String OPEN = "[ ";
- private static String CLOSE = " ]";
- private static String SEP = ", ";
-
+
public String convert(LoggingEvent le) {
Marker marker = le.getMarker();
if (marker == null) {
return EMPTY;
+ } else {
+ return marker.toString();
}
-
- if (!marker.hasChildren()) {
- return marker.getName();
- }
-
- Iterator it = marker.iterator();
- Marker child;
- StringBuffer sb = new StringBuffer(marker.getName());
- sb.append(' ').append(OPEN);
- while(it.hasNext()) {
- child = (Marker)it.next();
- sb.append(child.getName());
- if (it.hasNext()) {
- sb.append(SEP);
- }
- }
- sb.append(CLOSE);
-
- return sb.toString();
}
}
More information about the logback-dev
mailing list