Skip to content

Commit

Permalink
More constraint analyzer logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AZWN committed Aug 31, 2023
1 parent ca4982d commit 1a4437d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public AbstractConstraintAnalyzer(final AnalysisCommon analysisCommon, final IRe
if(results.results().isEmpty() && results.updates().isEmpty()) {
throw new AnalysisException(genericContext, "Analysis failed, no result was returned.");
}
return new SpoofaxAnalyzeResult(Iterables2.getOnlyElement(results.results()), results.updates(),
final ISpoofaxAnalyzeUnit unitResult = Iterables2.getOnlyElement(results.results());
plLogger.debug("analyze single: {}; messages: {}", unitResult.source(), unitResult.messages());
return new SpoofaxAnalyzeResult(unitResult, results.updates(),
results.context());
}

Expand Down Expand Up @@ -207,6 +209,7 @@ private ISpoofaxAnalyzeResults doAnalysis(Map<String, ISpoofaxParseUnit> changed
fullResults.addAll(removed.values());
fullResults.addAll(invalid.values());

plLogger.debug("full results: {}; updates: {}", fullResults, updateResults);
return new SpoofaxAnalyzeResults(fullResults, updateResults, context, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,15 @@ public AnalyzeContrib() {
@Override public String id() {
return "analyze";
}

@Override public String toString() {
final StringBuilder sb = new StringBuilder("AnalyzeUnit{");
sb.append(" ").append("valid=").append(valid).append(",");
sb.append(" ").append("success=").append(success).append(",");
sb.append(" ").append("hasAst=").append(hasAst).append(",");
sb.append(" ").append("messages=").append(messages).append(",");
sb.append(" ").append("duration=").append(duration).append(",");
return sb.append("}").toString();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,12 @@ public AnalyzeUnit(Unit unit, AnalyzeContrib contrib, ISpoofaxParseUnit parseUni
@Override public long duration() {
return contrib.duration;
}

@Override public String toString() {
final StringBuilder sb = new StringBuilder("AnalyzeUnit{");
sb.append(" ").append("parseUnit.source=").append(parseUnit.source()).append(",");
sb.append(" ").append("contrib=").append(contrib);
return sb.append("}").toString();
}

}

0 comments on commit 1a4437d

Please sign in to comment.