mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 23:30:55 +03:00
Avoid string concatenation in log statements.
This commit is contained in:
@@ -107,7 +107,7 @@ public class StreamCopier {
|
||||
log.debug("Done copying from {}", in);
|
||||
doneEvent.set();
|
||||
} catch (IOException ioe) {
|
||||
log.error("In pipe from {} to {}: " + ioe.toString(), in, out);
|
||||
log.error("In pipe from {} to {}: {}", new Object[] { in, out, ioe });
|
||||
doneEvent.deliverError(ioe);
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class StreamCopier {
|
||||
|
||||
final double timeSeconds = (System.currentTimeMillis() - startTime) / 1000.0;
|
||||
final double sizeKiB = count / 1024.0;
|
||||
log.info(sizeKiB + " KiB transferred in {} seconds ({} KiB/s)", timeSeconds, (sizeKiB / timeSeconds));
|
||||
log.info("{} KiB transferred in {} seconds ({} KiB/s)", new Object[] { sizeKiB, timeSeconds, (sizeKiB / timeSeconds) });
|
||||
|
||||
if (length != -1 && read == -1)
|
||||
throw new IOException("Encountered EOF, could not transfer " + length + " bytes");
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class Window {
|
||||
throws ConnectionException {
|
||||
synchronized (lock) {
|
||||
size -= dec;
|
||||
log.debug("Consuming by " + dec + " down to " + size);
|
||||
log.debug("Consuming by {} down to {}", dec, size);
|
||||
if (size < 0)
|
||||
throw new ConnectionException("Window consumed to below 0");
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SocketForwardingConnectListener
|
||||
@Override
|
||||
public void gotConnect(Channel.Forwarded chan)
|
||||
throws IOException {
|
||||
log.info("New connection from " + chan.getOriginatorIP() + ":" + chan.getOriginatorPort());
|
||||
log.info("New connection from {}:{}", chan.getOriginatorIP(), chan.getOriginatorPort());
|
||||
|
||||
final Socket sock = new Socket();
|
||||
sock.setSendBufferSize(chan.getLocalMaxPacketSize());
|
||||
|
||||
@@ -31,7 +31,7 @@ public class StatefulSFTPClient
|
||||
throws IOException {
|
||||
super(engine);
|
||||
this.cwd = getSFTPEngine().canonicalize(".");
|
||||
log.info("Start dir = " + cwd);
|
||||
log.info("Start dir = {}", cwd);
|
||||
}
|
||||
|
||||
private synchronized String cwdify(String path) {
|
||||
@@ -44,7 +44,7 @@ public class StatefulSFTPClient
|
||||
if (statExistence(cwd) == null) {
|
||||
throw new SFTPException(cwd + ": does not exist");
|
||||
}
|
||||
log.info("CWD = " + cwd);
|
||||
log.info("CWD = {}", cwd);
|
||||
}
|
||||
|
||||
public synchronized List<RemoteResourceInfo> ls()
|
||||
|
||||
Reference in New Issue
Block a user