diff options
| author | Christina Fu <cfu@redhat.com> | 2016-06-02 16:47:24 -0700 |
|---|---|---|
| committer | Christina Fu <cfu@redhat.com> | 2016-06-02 18:03:07 -0700 |
| commit | 897fd14bfdfa4cd722f95ba60c8dd7a9eaa37219 (patch) | |
| tree | fa45c0f5fd02e6bc0e805c0ecfb467694109045a /base/common/src/org | |
| parent | a8e71fb5aedd74a0822d3211d1cd08e0b5af3684 (diff) | |
| download | pki-897fd14bfdfa4cd722f95ba60c8dd7a9eaa37219.tar.gz pki-897fd14bfdfa4cd722f95ba60c8dd7a9eaa37219.tar.xz pki-897fd14bfdfa4cd722f95ba60c8dd7a9eaa37219.zip | |
Ticket #2271 Part2:TMS:removing/reducing debug log printout of data
This patch comments out unneeded data in TMS debug logs (TPS&TKS);
It reduces the size of the debug logs by a lot.
Note that for ease of later development debugging, the debug lines
are commented out instead of being removed
Diffstat (limited to 'base/common/src/org')
| -rw-r--r-- | base/common/src/org/dogtagpki/tps/TPSConnection.java | 17 | ||||
| -rw-r--r-- | base/common/src/org/dogtagpki/tps/main/Util.java | 2 | ||||
| -rw-r--r-- | base/common/src/org/dogtagpki/tps/msg/TPSMessage.java | 17 |
3 files changed, 31 insertions, 5 deletions
diff --git a/base/common/src/org/dogtagpki/tps/TPSConnection.java b/base/common/src/org/dogtagpki/tps/TPSConnection.java index d93827775..c5a971edd 100644 --- a/base/common/src/org/dogtagpki/tps/TPSConnection.java +++ b/base/common/src/org/dogtagpki/tps/TPSConnection.java @@ -46,7 +46,7 @@ public class TPSConnection { } public TPSMessage read() throws IOException { - CMS.debug("TPSMessage read()"); + CMS.debug("TPSConnection read()"); StringBuilder sb = new StringBuilder(); int b; @@ -80,7 +80,10 @@ public class TPSConnection { sb.append(c); } - CMS.debug("TPSMessage.read: Reading: " + sb.toString()); + if (size <= 38) // for pdu_data size is 2 and only contains status + CMS.debug("TPSConnection.read: Reading: " + sb.toString()); + else + CMS.debug("TPSConnection.read: Reading..."); // parse the entire message return TPSMessage.createMessage(sb.toString()); @@ -89,7 +92,15 @@ public class TPSConnection { public void write(TPSMessage message) throws IOException { String s = message.encode(); - CMS.debug("TPSMessage.write: Writing: " + s); + // don't print the pdu_data + int idx = s.lastIndexOf("pdu_data="); + String toDebug = null; + if (idx == -1) + CMS.debug("TPSConnection.write: Writing: " + s); + else { + toDebug = s.substring(0, idx-1); + CMS.debug("TPSConnection.write: Writing: " + toDebug + "pdu_data=<do not print>"); + } // send message out.print(s); diff --git a/base/common/src/org/dogtagpki/tps/main/Util.java b/base/common/src/org/dogtagpki/tps/main/Util.java index 2973bb8ec..b212478d7 100644 --- a/base/common/src/org/dogtagpki/tps/main/Util.java +++ b/base/common/src/org/dogtagpki/tps/main/Util.java @@ -432,7 +432,7 @@ public class Util { throw new EBaseException("Util.encryptData: called with no sym key or no data!"); } - CMS.debug("Util.encryptData: dataToEnc: " + dataToEnc.toHexString()); + //CMS.debug("Util.encryptData: dataToEnc: " + dataToEnc.toHexString()); CryptoToken token = null; try { diff --git a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java index f622b9b4d..c7ad7f7c3 100644 --- a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java +++ b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java @@ -510,7 +510,22 @@ public class TPSMessage { public static TPSMessage createMessage(String message) throws IOException { - CMS.debug("TPSMessage.createMessage: message: " + message); + // don't print the pdu_data + int idx1 = message.lastIndexOf("pdu_data="); + int idx2 = message.lastIndexOf("pdu_size="); + String toDebug1 = null; + String toDebug2 = null; + if (idx1 == -1) + CMS.debug("TPSMessage.createMessage: message: " + message); + else { + toDebug1 = message.substring(0, idx1-1); + if (idx2 == -1) + CMS.debug("TPSMessage.createMessage: message: " + toDebug1 + "pdu_data=<do not print>..."); + else { + toDebug2 = message.substring(idx2-1); + CMS.debug("TPSMessage.createMessage: message: " + toDebug1 + "&pdu_data=<do not print>"+ toDebug2); + } + } TPSMessage new_msg = new TPSMessage(message); |
