logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1335042 - /logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java
Date Mon, 07 May 2012 14:41:46 GMT
Author: ggregory
Date: Mon May  7 14:41:45 2012
New Revision: 1335042

URL: http://svn.apache.org/viewvc?rev=1335042&view=rev
Log:
Use a constant for EOL = "\r\n" instead of magic strings.

Modified:
    logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java?rev=1335042&r1=1335041&r2=1335042&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/net/TelnetAppender.java Mon May  7
14:41:45 2012
@@ -60,6 +60,7 @@ import java.util.Vector;
 
 public class TelnetAppender extends AppenderSkeleton {
 
+  private static final String EOL = "\r\n";
   private SocketHandler sh;
   private int port = 23;
 
@@ -122,7 +123,7 @@ public class TelnetAppender extends Appe
                 StringBuffer buf = new StringBuffer();
                 for(int i = 0; i < s.length; i++) {
                     buf.append(s[i]);
-                    buf.append("\r\n");
+                    buf.append(EOL);
                 }
                 sh.send(buf.toString());
             }
@@ -200,11 +201,11 @@ public class TelnetAppender extends Appe
                 connections.addElement(newClient);
                 writers.addElement(pw);
                 pw.print("TelnetAppender v1.0 (" + connections.size()
-		            + " active connections)\r\n\r\n");
+		            + " active connections)" + EOL + EOL);
                 pw.flush();
             }
           } else {
-            pw.print("Too many connections.\r\n");
+            pw.print("Too many connections." + EOL);
             pw.flush();
             newClient.close();
           }



Mime
View raw message