Skip to content

Commit

Permalink
[#149] Make the configuration more resilient to errors
Browse files Browse the repository at this point in the history
* small fix for logging undefined properties
  • Loading branch information
forgedhallpass committed Oct 6, 2020
1 parent 18ab5cc commit 51aaf91
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ public static String getProperty(final Properties properties, final String prope
if (Objects.isNull(defaultValue)) {
value = properties.getProperty(propertyName);
} else {
System.out.printf("The '%s' property was not defined, using '%s' as default value. %n", propertyName, defaultValue);
if (!properties.containsKey(propertyName)) {
// TODO use Logger instead when SLF4J is in place
System.out.printf("The '%s' property was not defined, using '%s' as default value. %n", propertyName, defaultValue);
}
value = properties.getProperty(propertyName, defaultValue);
}

Expand Down

0 comments on commit 51aaf91

Please sign in to comment.