Skip to content

Commit

Permalink
Fix off-by-one error in exception decoration code
Browse files Browse the repository at this point in the history
This was failing only in dev mode when using printf-style logging.

Fixes smallrye/smallrye-graphql#2230
  • Loading branch information
gsmet committed Nov 29, 2024
1 parent 0f88242 commit 64f0108
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public void accept(LogRecord logRecord, Consumer<LogRecord> logRecordConsumer) {
Object[] np = p != null ? Arrays.copyOf(p, p.length + 1) : new Object[1];
np[np.length - 1] = decoratedString;
elr.setParameters(np);
elr.setMessage(elr.getMessage() + "\n\n%" + (np.length - 1) + "$s",
elr.setMessage(elr.getMessage() + "\n\n%" + np.length + "$s",
ExtLogRecord.FormatStyle.PRINTF);
}
case NO_FORMAT -> {
Expand Down

0 comments on commit 64f0108

Please sign in to comment.