Skip to content

Commit

Permalink
fix: remove prints that happen before logger configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelger committed Nov 11, 2024
1 parent 49367b9 commit 803036d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected CHosts loadHostsConfiguration(Path hostConfigurationFile) {

private <T> T loadJsonConfiguration(Path configurationFile, Class<T> clazz) throws ExecutionException {
try (InputStream inputStream = loadResource(configurationFile)) {
return new ObjectInstantiation<>(clazz, getLogger()).read(inputStream);
return new ObjectInstantiation<>(clazz).read(inputStream);
} catch (IOException | InstantiationException e) {
printAndLog("Could not load file due to invalid format.", e);
throw new ExecutionException();
Expand All @@ -223,7 +223,7 @@ private <T> T loadJsonConfiguration(Path configurationFile, Class<T> clazz) thro
@SuppressWarnings("unchecked")
private <T> T loadJsonConfiguration(Path configurationFile, T defaultObject) {
try (InputStream inputStream = loadResource(configurationFile)) {
return new ObjectInstantiation<>((Class<T>) defaultObject.getClass(), getLogger()).read(inputStream);
return new ObjectInstantiation<>((Class<T>) defaultObject.getClass()).read(inputStream);
} catch (IOException | InstantiationException e) {
getLogger().warn("Could not load file {}. Using default configuration.", configurationFile);
return defaultObject;
Expand Down

0 comments on commit 803036d

Please sign in to comment.