qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1628387 - /qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
Date Tue, 30 Sep 2014 10:33:46 GMT
Author: robbie
Date: Tue Sep 30 10:33:46 2014
New Revision: 1628387

URL: http://svn.apache.org/r1628387
Log:
NO-JIRA: add basic config toggle for the length of payload included in the frame trace logging,
for cases where the hard coded value doesnt quite suit

Modified:
    qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java

Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java?rev=1628387&r1=1628386&r2=1628387&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
(original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
Tue Sep 30 10:33:46 2014
@@ -76,6 +76,7 @@ public class TransportImpl extends Endpo
     }
 
     private static final boolean FRM_ENABLED = getBooleanEnv("PN_TRACE_FRM");
+    private static final int TRACE_FRAME_PAYLOAD_LENGTH = Integer.getInteger("proton.trace_frame_payload_length",
80);
 
     // trace levels
     private int _levels = (FRM_ENABLED ? this.TRACE_FRM : 0);
@@ -1452,8 +1453,8 @@ public class TransportImpl extends Endpo
             msg.append(" ").append(event).append(" ").append(frame.getBody());
             if (frame.getPayload() != null) {
                 String payload = frame.getPayload().toString();
-                if (payload.length() > 80) {
-                    payload = payload.substring(0, 80) + "(" + payload.length() + ")";
+                if (payload.length() > TRACE_FRAME_PAYLOAD_LENGTH) {
+                    payload = payload.substring(0, TRACE_FRAME_PAYLOAD_LENGTH) + "(" + payload.length()
+ ")";
                 }
                 msg.append(" \"").append(payload).append("\"");
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message