summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-09-22 15:41:07 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-09-22 15:53:00 +0200
commit9f5ac4f9aacfe3066cceb3106e57cb52343ff0f8 (patch)
treefb36ea54845852d1518e5af1df805545c7f90264 /src
parent2b15edd224cc6dcff90e170959102eb1a1bb1a50 (diff)
Add different log in AbstractModelElement
Log changed when the Json attribute value is null or empty Change-Id: Ie0321efbbcc7f9c637f1bd8ea44001e5036987d3 Issue-ID: CLAMP-54 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java b/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java
index a7dd5cbf0..7038dc6cf 100644
--- a/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java
+++ b/src/main/java/org/onap/clamp/clds/model/prop/AbstractModelElement.java
@@ -37,8 +37,8 @@ import java.util.List;
* ...)
*/
public abstract class AbstractModelElement {
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractModelElement.class);
- protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractModelElement.class);
+ protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
private final String type;
private final ModelBpmn modelBpmn;
@@ -49,6 +49,9 @@ public abstract class AbstractModelElement {
private final ModelProperties modelProp;
+ private static final String LOG_ELEMENT = "Value '";
+ private static final String LOG_NOT_FOUND = "' for key 'name' not found in JSON";
+
/**
* Perform base parsing of properties for a ModelElement (such as,
* Collector, StringMatch, Policy and Tca)
@@ -116,9 +119,9 @@ public abstract class AbstractModelElement {
}
}
if (value == null || value.length() == 0) {
- logger.warn(name + "=" + value);
+ logger.warn(LOG_ELEMENT + name + LOG_NOT_FOUND);
} else {
- logger.debug(name + "=" + value);
+ logger.debug(LOG_ELEMENT + name + LOG_NOT_FOUND + nodeIn.toString());
}
return value;
}
@@ -137,9 +140,9 @@ public abstract class AbstractModelElement {
value = nodeIn.path(name).asText();
}
if (value == null || value.length() == 0) {
- logger.warn(name + "=" + value);
+ logger.warn(LOG_ELEMENT + name + LOG_NOT_FOUND);
} else {
- logger.debug(name + "=" + value);
+ logger.debug(LOG_ELEMENT + name + LOG_NOT_FOUND + nodeIn.toString());
}
return value;
}
@@ -206,9 +209,9 @@ public abstract class AbstractModelElement {
}
}
if (values == null || values.isEmpty()) {
- logger.warn(name + "=" + values);
+ logger.warn(LOG_ELEMENT + name + LOG_NOT_FOUND);
} else {
- logger.debug(name + "=" + values);
+ logger.debug(LOG_ELEMENT + name + LOG_NOT_FOUND + nodeIn.toString());
}
return values;
}