Skip to content

Log unpacking at debug level#1624

Merged
elharo merged 2 commits into
masterfrom
1618
May 17, 2026
Merged

Log unpacking at debug level#1624
elharo merged 2 commits into
masterfrom
1618

Conversation

@elharo
Copy link
Copy Markdown
Contributor

@elharo elharo commented May 17, 2026

We've been logging this when info logs are not enabled and not logging it when they are. Either way, these logs are noisy so set this to to log at debug level.

fixes #1618

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts UnpackUtil.logUnpack() logging so the “Unpacking …” message is no longer emitted at INFO level (addressing the inverted/incorrect logging behavior described in #1618) and is intended to only appear when debug logging is enabled.

Changes:

  • Reworked logUnpack() to gate message construction on isDebugEnabled().
  • Intended to move the unpack log message from INFO to DEBUG to reduce log noise.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +159 to 183
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());
}
@slawekjaranowski
Copy link
Copy Markdown
Member

Simillary here title of PR not describe what we do ....
Will be used in release notes, please look:
https://github.com/apache/maven-dependency-plugin/releases

@slawekjaranowski
Copy link
Copy Markdown
Member

also labels is used to categorize PR in release notes

@elharo elharo changed the title Debug log unpacking Log unpacking at debug level May 17, 2026
@elharo
Copy link
Copy Markdown
Contributor Author

elharo commented May 17, 2026

done

@elharo elharo merged commit 9bb5af7 into master May 17, 2026
21 checks passed
@elharo elharo deleted the 1618 branch May 17, 2026 19:53
@github-actions github-actions Bot added this to the 3.11.0 milestone May 17, 2026
@github-actions
Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

@elharo elharo added the bug Something isn't working label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix inverted logging logic in UnpackUtil.logUnpack()

3 participants