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.
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
[JENKINS-68417] Revert
LogRecord
tricks #6643[JENKINS-68417] Revert
LogRecord
tricks #6643Changes from 4 commits
0953300
e0a03e1
d4669e0
e5c3474
382ad64
8e02298
64a8fab
b572e70
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
A call to
super.isLoggable(record)
does this null check, and it also checks whether theLogRecord
has an appropriate level and whether it satisfies any filter. In practice, the level check is handled byhudson.logging.LogRecorder.Target#matches
and subclasses are unlikely to implement a filter, but callingsuper.isLoggable(record)
here results in a slight deduplication of code and makes this subclass ofHandler
consistent with the subclasses ofHandler
provided by the Java Platform, so I think this is worth doing.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 will have to double-check, but I think this is what we do not want to do because this would prevent custom fine loggers from getting anything. Regular handlers either print a message to a sink or do not; handlers which collect all messages need to behave differently. https://github.com/jenkinsci/support-core-plugin/blob/7e75fdc7e9af0abe0d7d659a3e6e591c3451288f/src/main/java/com/cloudbees/jenkins/support/SupportLogHandler.java#L128-L135
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 do not see how it could because we never mutate
java.util.logging.Handler#logLevel
from its default value ofALL
inRingBufferLogHandler
. Like I wrote earlier, I do not think there is a difference in practice, but I think using the built-in method better adheres to the parent class's extensible design just in case a theoretical subclass ofRingBufferLogHandler
wanted to use a custom level or filter.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.
It appears to work. Still, I would rather not do it here because
tooMuchRecordsShouldNotCrashHandler
was not testing anything.)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 rather just make it
final
than consider such possibilities.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 am OK with making it
final
.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.
hide whitespace in diff