GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve log messages by michael-o · Pull Request #854 · apache/maven-shade-plugin

Conversation

@michael-o

@michael-o michael-o commented Sep 20, 2026

Copy link
Copy Markdown
Member

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@michael-o michael-o added this to the 3.6.3 milestone Sep 20, 2026
@michael-o michael-o mentioned this pull request Sep 20, 2026
[MSHADE-400] Self-minimisation with custom entry points #110
Merged
3 of 4 tasks
@asf-gitbox-commits
asf-gitbox-commits force-pushed the kriegaex-improvements branch from 17bdef0 to 95dfc40 Compare September 20, 2026 10:11
slachiewicz
slachiewicz approved these changes Sep 20, 2026
View reviewed changes
rmannibucau
rmannibucau approved these changes Sep 20, 2026
View reviewed changes
kriegaex
kriegaex suggested changes Sep 21, 2026
View reviewed changes

@kriegaex kriegaex left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Of course, my review is non-binding, but you might want to consider the suggestions anyway. 🙂

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java
repeatScan |= scanServiceProviderConfigFile(cp, configFileReader);
} catch (final IOException e) {
log.warn(e.getMessage());
log.warn("Failed to scan service provider config file " + serviceProviderConfigFile, e);

@kriegaex kriegaex Sep 21, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would prefer

log.warn( "Failed to scan service provider config file " + serviceProviderConfigFile );
log.debug( e );

Less noise in the warn log, full exception stack trace in the debug log.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau Sep 21, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

think it is saner to keep it together (or totally duplicate the line) cause loggers are not output streams, warn and debug can be routed to different output and there is no order delivery guarantee between them if executed super fast

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kriegaex kriegaex Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@rmannibucau I thought that the log channels also correspond to log levels, i.e. that e.g. debug is a superset of warn with more detail. Is that assumption false? Is it really necessary to force users to see stack traces in the warn log?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Sep 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

both messages are disjoint and that is not OK to print it like that, moreove it would need to consistent with the rest of the log statements which it is not.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau Sep 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@kriegaex it is not a superset just a plain hierarchy but you cant assume 2 disjoint messages will be linked if there is no explicit link between there like there

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Sep 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What can be done is:

if (debug enabled)
log.warn(message, e)
else
log.warn(message)

This pattern we us in several places.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau Sep 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

if (debug enabled)
log.warn(message, e)
else
log.warn(message + "'" + e.getMessage() + "'")

maybe (or anything formatting you like) to not loose the error message which is often the key to understand the error - less critical when you have the real stack/causes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java
}
} catch (final IOException e) {
log.warn("Not a JAR file candidate. Ignoring classpath element '" + fileName + "' (" + e + ").");
log.warn("Not a JAR file candidate. Ignoring classpath element '" + fileName + "'", e);

@kriegaex kriegaex Sep 21, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Here, I also would rather split the warning and logging the exception stack trace, see above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Sep 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No, see above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kriegaex
kriegaex approved these changes Sep 22, 2026
View reviewed changes

@kriegaex kriegaex left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If the regular committers in the project disagree with my suggestions, there is nothing I can do. I can live with the result of this PR. Thank you so much for taking the time to open and process it upon my request. I do appreciate that. 🙂

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

michael-o reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@michael-o
Improve log messages
b9317aa
@asf-gitbox-commits
asf-gitbox-commits force-pushed the kriegaex-improvements branch from 95dfc40 to b9317aa Compare September 26, 2026 15:54
@michael-o

michael-o commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

Merged with 7388b57.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o michael-o closed this Sep 26, 2026
@michael-o
michael-o deleted the kriegaex-improvements branch September 26, 2026 16:37
@github-actions github-actions Bot removed this from the 3.6.3 milestone Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rmannibucau rmannibucau rmannibucau approved these changes
@slachiewicz slachiewicz slachiewicz approved these changes
+1 more reviewer
@kriegaex kriegaex kriegaex approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@michael-o @rmannibucau @kriegaex @slachiewicz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.