logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1557619 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
Date Sun, 12 Jan 2014 22:21:26 GMT
Author: rgoers
Date: Sun Jan 12 22:21:25 2014
New Revision: 1557619

URL: http://svn.apache.org/r1557619
Log:
Ignore linefeed character in LoggerStream

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java?rev=1557619&r1=1557618&r2=1557619&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerStream.java
Sun Jan 12 22:21:25 2014
@@ -280,6 +280,9 @@ public class LoggerStream extends PrintS
 
         @Override
         public synchronized void write(int b) {
+            if (b == '\r') {
+                return;
+            }
             super.write(b);
             if (b == '\n') {
                 log(count - 1);
@@ -288,10 +291,8 @@ public class LoggerStream extends PrintS
 
         @Override
         public synchronized void write(byte[] b, int off, int len) {
-            super.write(b, off, len);
-            int newLine = lastIndexOf('\n');
-            if (newLine != -1) {
-                log(newLine);
+            for (int i = 0; i < len; ++i) {
+                write(b[off + i]);
             }
         }
     }



Mime
View raw message