Refactor few LOG messages management
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / catalog / CatalogUtils.java
index 3737a33867c0bf8359096772aa49f7a378cf8e17..f4a807f8c7edd5c25e5d276494e0464ccde6f7cf 100644 (file)
@@ -424,12 +424,14 @@ public class CatalogUtils {
             .filter(val -> val.getUpToBoundary().doubleValue() >= calculatedParameter)
             // takes the immediate greater or equal value
             .findFirst().orElse(null);
-        return penalty == null
+        if (penalty == null) {
             //means a boundary that is greater than calculatedParameter couldn't be found
             // Out of specification!
-                ? 9999.9
-            // In spec, return penalty associated with calculatedParameter
-                : penalty.getPenaltyValue().getValue().doubleValue();
+            return 9999.9;
+        }
+        // In spec, return penalty associated with calculatedParameter
+        LOG.info("Penalty for {} is {} dB", impairmentType, penalty.getPenaltyValue().getValue().doubleValue());
+        return penalty.getPenaltyValue().getValue().doubleValue();
     }
 
     /**