implements PR-O1.1

This commit is contained in:
2026-03-24 13:42:26 +00:00
parent bfa5f06fb6
commit b5c372efb2
7 changed files with 63 additions and 14 deletions
@@ -10,16 +10,39 @@ public class BuildingIssue {
private final boolean error;
private final String message;
private final Throwable exception;
private final String phase;
private final String code;
private final Integer functionIndex;
private final Integer pc;
public void print(LogAggregator logs) {
final var composed = composeMessage();
if (error) {
if (exception != null) {
logs.error(message, exception);
logs.error(composed, exception);
} else {
logs.error(message);
logs.error(composed);
}
} else {
logs.warn(message);
logs.warn(composed);
}
}
private String composeMessage() {
final var sb = new StringBuilder();
if (phase != null && !phase.isBlank()) {
sb.append('[').append(phase).append(']').append(' ');
}
if (code != null && !code.isBlank()) {
sb.append('(').append(code).append(')').append(' ');
}
sb.append(message == null ? "" : message);
if (functionIndex != null && functionIndex >= 0) {
sb.append(" [fn=").append(functionIndex).append(']');
}
if (pc != null && pc >= 0) {
sb.append(" [pc=").append(pc).append(']');
}
return sb.toString().trim();
}
}