Conversation
17bdef0 to
95dfc40
Compare
kriegaex
left a comment
There was a problem hiding this comment.
Of course, my review is non-binding, but you might want to consider the suggestions anyway. 🙂
| repeatScan |= scanServiceProviderConfigFile(cp, configFileReader); | ||
| } catch (final IOException e) { | ||
| log.warn(e.getMessage()); | ||
| log.warn("Failed to scan service provider config file " + serviceProviderConfigFile, e); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
What can be done is:
if (debug enabled)
log.warn(message, e)
else
log.warn(message)
This pattern we us in several places.
There was a problem hiding this comment.
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
| } | ||
| } 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); |
There was a problem hiding this comment.
Here, I also would rather split the warning and logging the exception stack trace, see above.
kriegaex
left a comment
There was a problem hiding this comment.
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. 🙂
95dfc40 to
b9317aa
Compare
|
Merged with 7388b57. |
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
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.