-
Notifications
You must be signed in to change notification settings - Fork 28
Add WrapExpensiveLogStatementsInConditionals
to Slf4jBestPractices
#216
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
Add WrapExpensiveLogStatementsInConditionals
to Slf4jBestPractices
#216
Conversation
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 727-726
- lines 735-734
- lines 781-800
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 760-759
- lines 768-767
- lines 814-833
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 768-767
- lines 814-833
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 768-767
- lines 814-833
@@ -66,78 +52,78 @@ public String getDisplayName() { | |||
@Override | |||
public String getDescription() { |
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.
Should the description reflect the restriction in loglevels it operates on?
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 768-767
- lines 814-833
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 768-767
- lines 814-833
InexpensiveSLF4JLoggers
to Slf4jBestPractices
WrapExpensiveLogStatementsInConditionals
to Slf4jBestPractices
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.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 29-30
- lines 38-39
- lines 54-56
- lines 64-66
- lines 814-833
- lines 961-960
What's your motivation?
Not having to run this recipe individually, or having to remember to add it to a composite
Anyone you would like to review specifically?
This now fails
org.openrewrite.java.logging.slf4j.Slf4jBestPracticesTest#exceptionIsAppendedAtEndOfLogMessage
; I wonder if we should even add these conditional blocks for log levels warn & error, as they are hardly ever disabled. Maybe make it optionally configurable and only add blocks up toinfo
by default?Any additional context