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

(cherry picked from commit 64f0108)
  • Loading branch information
gsmet committed Nov 30, 2024
1 parent 1a5fe71 commit e4d67fc
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 e4d67fc

Please sign in to comment.