Copilot commented on code in PR #1624:
URL:
https://github.com/apache/maven-dependency-plugin/pull/1624#discussion_r3254641523
##########
src/main/java/org/apache/maven/plugins/dependency/utils/UnpackUtil.java:
##########
@@ -156,32 +156,30 @@ public void unpack(
}
private void logUnpack(Log logger, File file, File location, String
includes, String excludes) {
- if (logger.isInfoEnabled()) {
- return;
- }
+ if (logger.isDebugEnabled()) {
+ StringBuilder msg = new StringBuilder();
+ msg.append("Unpacking ");
+ msg.append(file);
+ msg.append(" to ");
+ msg.append(location);
+
+ if (includes != null && excludes != null) {
+ msg.append(" with includes \"");
+ msg.append(includes);
+ msg.append("\" and excludes \"");
+ msg.append(excludes);
+ msg.append("\"");
+ } else if (includes != null) {
+ msg.append(" with includes \"");
+ msg.append(includes);
+ msg.append("\"");
+ } else if (excludes != null) {
+ msg.append(" with excludes \"");
+ msg.append(excludes);
+ msg.append("\"");
+ }
- StringBuilder msg = new StringBuilder();
- msg.append("Unpacking ");
- msg.append(file);
- msg.append(" to ");
- msg.append(location);
-
- if (includes != null && excludes != null) {
- msg.append(" with includes \"");
- msg.append(includes);
- msg.append("\" and excludes \"");
- msg.append(excludes);
- msg.append("\"");
- } else if (includes != null) {
- msg.append(" with includes \"");
- msg.append(includes);
- msg.append("\"");
- } else if (excludes != null) {
- msg.append(" with excludes \"");
- msg.append(excludes);
- msg.append("\"");
+ logger.debug(msg.toString());
}
Review Comment:
`logUnpack()` gates on `logger.isDebugEnabled()` but then logs via
`logger.info(...)`. This means the message is still emitted at INFO level (and
may not show at all if INFO is disabled), which doesn’t match the PR/issue
intent of moving this noisy message to DEBUG. Use `logger.debug(...)` here (and
optionally early-return when `!logger.isDebugEnabled()` to avoid building the
message).
--
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]