Skip to content

Commit

Permalink
Merge pull request #309 from aloubyansky/no-traces-message
Browse files Browse the repository at this point in the history
Let a user know, in case no traces were found using quarkus --trace command
  • Loading branch information
aloubyansky committed Dec 11, 2023
2 parents f820412 + 1437559 commit 46fdb09
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions domino/app/src/main/java/io/quarkus/domino/cli/Quarkus.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ public void handleResolutionFailures(Collection<Artifact> artifacts) {

treeProcessor.process();

int membersWithTraces = 0;
for (var report : memberReports) {
if (report.enabled && report.hasTraces()) {
++membersWithTraces;
log.info("");
log.info("== " + report.metadata.getBom().getGroupId().toUpperCase()
+ ":" + report.metadata.getBom().getArtifactId().toUpperCase()
Expand Down Expand Up @@ -303,6 +305,22 @@ public void handleResolutionFailures(Collection<Artifact> artifacts) {
}
}
log.info("");

if (trace != null && !trace.isEmpty() && membersWithTraces == 0) {
var sb = new StringBuilder()
.append("No traces of ");
var i = trace.iterator();
sb.append(i.next());
if (i.hasNext()) {
var next = i.next();
while (i.hasNext()) {
sb.append(", ").append(next);
next = i.next();
}
sb.append(" and ").append(next);
}
log.info(sb.append(" found").toString());
}
return 0;
}

Expand Down

0 comments on commit 46fdb09

Please sign in to comment.