diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-06-09 17:46:44 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-06-09 17:46:44 +0000 |
commit | 09d52f0d2c4eee01a29dd068cbc31415db9d9c83 (patch) | |
tree | 00339c486ed5f44216ede3fe5b8f5ace7c5e7191 /qpid | |
parent | 806b7385b193bf83d89c375155d2ae0a8edbf796 (diff) | |
download | qpid-python-09d52f0d2c4eee01a29dd068cbc31415db9d9c83.tar.gz |
QPID-901: made logging of ids less expensive, also limit how much data we dump into the log
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@665798 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
3 files changed, 16 insertions, 4 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java index 72c1c3331d..4f61380809 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java @@ -83,6 +83,7 @@ public class Data implements ProtocolEvent StringBuffer str = new StringBuffer(); str.append("Data("); boolean first = true; + int left = 64; for (ByteBuffer buf : getFragments()) { if (first) @@ -93,7 +94,12 @@ public class Data implements ProtocolEvent { str.append(" | "); } - str.append(str(buf)); + str.append(str(buf, left)); + left -= buf.remaining(); + if (left < 0) + { + break; + } } str.append(")"); return str.toString(); diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java index 54125eb03f..7c6b7daf85 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java @@ -123,10 +123,11 @@ public class Session extends Invoker return commandsIn++; } - void identify(Method cmd) + final void identify(Method cmd) { - cmd.setId(nextCommandId()); - log.debug("ID: [%s] %s", this.channel, cmd); + int id = nextCommandId(); + cmd.setId(id); + log.debug("ID: [%s] %s", this.channel, id); } public void processed(Method command) diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java index a1d74a51ce..0038cdf118 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java @@ -70,6 +70,11 @@ public class Functions str.append('"'); + if (limit < buf.remaining()) + { + str.append("..."); + } + return str.toString(); } |