summaryrefslogtreecommitdiffstats
path: root/policy-management/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-09-03 10:15:32 -0400
committerJim Hahn <jrh3@att.com>2021-09-03 10:44:17 -0400
commit3557b257aaf8f260956458993a678b88a062068b (patch)
treeee6bd59505569230eb4bf76bb9bda6002f7256d4 /policy-management/src
parenteeecf007158660b8e279467146fcee14e71dc804 (diff)
Reduce coder verbosity in logs
After switching to lombok ToString, the log messages for the coder class have become very long. Switched back to the original toString() method, which only logs the keysets rather than the whole content of the coder maps. Left the other additions of lombok ToString in drools-pdp as is, because they all looked appropriate, upon further review. Addressed review comments: - added comment about why lombok isn't used Issue-ID: POLICY-3397 Change-Id: I08ea8c49908b33fc3b8c8ba6de4ac4bd1474660a Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-management/src')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/GenericEventProtocolCoder.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/GenericEventProtocolCoder.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/GenericEventProtocolCoder.java
index 8c734d52..0729c706 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/GenericEventProtocolCoder.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/GenericEventProtocolCoder.java
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import lombok.ToString;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.controller.DroolsControllerConstants;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder.CoderFilters;
@@ -38,7 +37,6 @@ import org.slf4j.LoggerFactory;
* This protocol Coder that does its best attempt to decode/encode, selecting the best class and best fitted json
* parsing tools.
*/
-@ToString
@NoArgsConstructor(access = AccessLevel.PROTECTED)
abstract class GenericEventProtocolCoder {
private static final String INVALID_ARTIFACT_ID_MSG = "Invalid artifact id";
@@ -720,4 +718,17 @@ abstract class GenericEventProtocolCoder {
}
return droolsControllers;
}
+
+ /*
+ * Note: this only logs the KEYSETS, thus lombok ToString annotation is not used.
+ * Otherwise, it results in too much verbosity.
+ */
+ @Override
+ public String toString() {
+ return "GenericEventProtocolCoder [coders="
+ + coders.keySet()
+ + ", reverseCoders="
+ + reverseCoders.keySet()
+ + "]";
+ }
}