Skip to content

Commit

Permalink
Add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed May 13, 2024
1 parent f52d79f commit 250c3a8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.*;
import java.util.stream.Collectors;

import org.antlr.v4.parse.ANTLRParser.finallyClause_return;
import org.cqframework.cql.cql2elm.CqlCompilerException;
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
import org.cqframework.cql.cql2elm.CqlTranslator;
Expand Down Expand Up @@ -36,9 +35,12 @@
import org.opencds.cqf.tooling.npm.NpmLibrarySourceProvider;
import org.opencds.cqf.tooling.npm.NpmModelInfoProvider;
import org.opencds.cqf.tooling.utilities.ResourceUtils;
import org.slf4j.Logger;

public class CqlProcessor {

private static final Logger log = org.slf4j.LoggerFactory.getLogger(CqlProcessor.class);

/**
* information about a cql file
*/
Expand Down Expand Up @@ -394,6 +396,8 @@ private void translateFile(LibraryManager libraryManager, File file, CqlCompiler


if (!severeErrorList.isEmpty()) {
var messages = severeErrorList.stream().map(x -> x.getMessage()).reduce("", (x, y) -> x + "\n" + y);
log.error("CQL Processing failed with errors count: {}, messages: {}", severeErrorList.size(), messages);
result.getErrors().add(new ValidationMessage(ValidationMessage.Source.Publisher, IssueType.EXCEPTION, file.getName(),
String.format("CQL Processing failed with (%d) errors.", translator.getErrors().size()), IssueSeverity.ERROR));
}
Expand Down

0 comments on commit 250c3a8

Please sign in to comment.