-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLF4J-related fixes #57
Open
ghost
wants to merge
13
commits into
apache:trunk
Choose a base branch
from
unknown repository
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As suggested in the SLF4J FAQ: https://www.slf4j.org/faq.html#logging_performance .. parameterized logging can improve the efficiency of logger calls when logging at the specified level is disabled. In addition, per the FAQ: https://www.slf4j.org/faq.html#paramException since SLF4J 1.6.0 it is possible to use parameterized logging and also log an exception/throwable. toString() is called automatically: https://www.slf4j.org/faq.html#string_contents These changes were suggested by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
String concatenations were assigned to local variables which were then logged, but not used for another purpose. It is more efficient to use parameterized logging in such cases.
The syntax of a formatting anchor is '{}'. This issue was found by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
Eliminates the need to construct a new (temporary) Object array object. These changes were suggested by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
Since SLF4J 1.6.0, it is possible to use parameterized logging and also log an exception/throwable. Log the PathNotFoundExceptions because comments indicates that execution should not reach the catch blocks; if it does, then the stack traces may be useful.
Some calls to warn() were guarded by checks that logging at the debug level is enabled. These issues were found by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
…abled These changes were suggested by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
Eliminates the need to construct a new (temporary) Object array object.
Arrays.asList(...).toString() might be an expensive string concatenation.
It appears to be the intention to log the invalid path name rather than DEFAULT_ACE_NAME.
The result is still a constant expression, and not making the constants formatting args potentially allows the logger overloads taking at most two formatting args to be used, avoiding an unnecessary Object array creation.
SLF4J 1.6.0+ allows one extra exception/throwable at the end of the format args list. In one case, the extra exception was placed at the beginning. In three other cases, the exception object's message was passed. Two logger calls had more formatting anchor(s) in the format string than format args. These issues were found by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.