gnodet-bot commented on PR #14177:
URL: https://github.com/apache/maven/pull/14177#issuecomment-7281529687
While reviewing this PR, we noticed that
`org.apache.maven.api.logging.LogEventBuilder` currently has no
`addArgument(Supplier<?>)` method (unlike SLF4J 2.x's `LoggingEventBuilder`),
making it impossible to combine a parameterized format string with
lazily-evaluated arguments for 3+ args.
For example, the `DefaultModelBuilder.java` stream-collecting debug calls
(flagged above) could ideally be written as:
```java
logger.atDebug()
.addArgument(childModel::getId)
.addArgument(() -> repositories.stream()
.map(Object::toString)
.collect(Collectors.joining("\n", " ", "")))
.log("Merging repositories from {0}\n{1}");
```
This would replace both the `isDebugEnabled()` guard and the string
concatenation. Tracked in #14188.
_This comment was generated by an AI agent, Hermès on behalf of @gnodet._
<!-- reviewer: gnodet-bot -->
--
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]