nanzcakep opened a new issue, #145:
URL: https://github.com/apache/logging-log4j-kotlin/issues/145
There is a vararg forwarding bug in two Kotlin wrapper APIs, where the
argument array is passed as a single object instead of being spread. This
causes malformed formatted output and loss/distortion of log detail.
**Affected APIs**
1. ContextStack.push(message: String, vararg args: Any?)
2. KotlinLogger.traceEntry(message: String, vararg args: Any?)
**Problem**
Current forwarding passes args without spread, so placeholders are not
expanded as intended.
For example, for ContextStack:
- Input format: user={} action={}
- Input args: alice, login
- Observed output: user=[alice, login] action={}
- Expected output: user=alice action=login
**Reproduction**
Environment used:
- Branch: main
- Commit: b6ab1b9a7cdd37d1faabb7ac62f26193ac9b6a90
- JDK: 17
**Command used:**
./mvnw -pl log4j-api-kotlin -Dtest=VarargForwardingParityTest test
**Observed test failure:**
- expected: <user=alice action=login> but was: <user=[alice, login]
action={}>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]