You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/10/23 19:36:04 UTC
svn commit: r1813068 -
/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
Author: pmouawad
Date: Mon Oct 23 19:36:03 2017
New Revision: 1813068
URL: http://svn.apache.org/viewvc?rev=1813068&view=rev
Log:
Improve logging
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
Modified: jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java?rev=1813068&r1=1813067&r2=1813068&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java (original)
+++ jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java Mon Oct 23 19:36:03 2017
@@ -73,7 +73,7 @@ public class TCPClientImpl extends Abstr
@Override
public void write(OutputStream os, String s) throws IOException{
if(log.isDebugEnabled()) {
- log.debug("WriteS: " + showEOL(s));
+ log.debug("WriteS: {}", showEOL(s));
}
os.write(s.getBytes(CHARSET));
os.flush();
@@ -87,7 +87,7 @@ public class TCPClientImpl extends Abstr
byte[] buff = new byte[512];
while(is.read(buff) > 0){
if(log.isDebugEnabled()) {
- log.debug("WriteIS: " + showEOL(new String(buff, CHARSET)));
+ log.debug("WriteIS: {}", showEOL(new String(buff, CHARSET)));
}
os.write(buff);
os.flush();
@@ -109,7 +109,7 @@ public class TCPClientImpl extends Abstr
ByteArrayOutputStream w = new ByteArrayOutputStream();
try {
byte[] buffer = new byte[4096];
- int x = 0;
+ int x;
boolean first = true;
while ((x = is.read(buffer)) > -1) {
if (first) {
@@ -124,7 +124,7 @@ public class TCPClientImpl extends Abstr
// do we need to close byte array (or flush it?)
if(log.isDebugEnabled()) {
- log.debug("Read: " + w.size() + "\n" + w.toString());
+ log.debug("Read: {}\n{}", w.size(), w.toString());
}
return w.toString(CHARSET);
} catch (IOException e) {