Skip to content

Commit

Permalink
[WFCORE-6503]: Adding WARNING traces
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Hugonnet <[email protected]>
  • Loading branch information
ehsavoie committed Mar 1, 2024
1 parent a549626 commit d00ce87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3755,4 +3755,8 @@ OperationFailedRuntimeException capabilityAlreadyRegisteredInContext(String capa

@Message(id = 505, value = "Unsuported deployment yaml file %s with attributes %s")
IllegalArgumentException unsupportedDeployment(String deployment, Set<String> attribues);

@LogMessage(level = WARN)
@Message(id = 506, value = "The yaml element %s is ignored")
void ignoreYamlElement(String yaml);
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ private void load() {
for (Path file : files) {
if (file != null && Files.exists(file) && Files.isRegularFile(file)) {
Map<String, Object> yamlConfig = Collections.emptyMap();
Yaml yaml = new Yaml(new OperationConstructor(new LoaderOptions()));
try (InputStream inputStream = Files.newInputStream(file)) {
Yaml yaml = new Yaml(new OperationConstructor(new LoaderOptions()));
yamlConfig = yaml.load(inputStream);
} catch (IOException ioex) {
throw MGMT_OP_LOGGER.failedToParseYamlConfigurationFile(file.toAbsolutePath().toString(), ioex);
Expand All @@ -115,6 +115,8 @@ private void load() {
Object value = config.remove(excluded);
if(value != null && value instanceof Map && DEPLOYMENT.equals(excluded)) {
deployments.putAll((Map<String, Object>) value);
} else if (value != null){
MGMT_OP_LOGGER.ignoreYamlElement(yaml.dump(value));
}
}
parsedFiles.add(file.toAbsolutePath().toString());
Expand Down

0 comments on commit d00ce87

Please sign in to comment.