Sanne Grinovero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-17000 (
https://hibernate.atlassian.net/browse/HHH-17000?atlOrigin=eyJpIjoiOGQxYT...
)
Re: Do not keep static references to log levels (
https://hibernate.atlassian.net/browse/HHH-17000?atlOrigin=eyJpIjoiOGQxYT...
)
Hi James, this was a “convention” started at first by the Infinispan team, but then
applied across several projects. There’s certainly tradeoffs, and perhaps it’s time to
revisit them as I don’t know how much it’s applicable today, but this was intentional.
Essentially expressing it as a final constant has two benefits (which might be out of
date):
* it helps code elimination in GraalVM
* the performance help in JVM - like you say, it’s extemely marginal but it has been show
to exist, and in some cases it matters.
Now as it happens, both of the above points are highly contexctual, but we had some
situations in which they did matter. The alternative to this pattern being to fully remove
such statements from the source code.
Rather than fully removing it, we decided that we consider the “trace” level as something
that is allowed to be folded as a constant. So I’d not consider it as a bug because if
people want to “flip” this dynamically… if I remove such statements instead they won’t be
able to log them at all. Perhaps JBoss Logger could address this need explicitly? As I see
it, what puzzles our users most is that this “convention” isn’t advertised enough.
What we could do, if these are particularly useful, is to re-evaluate if they should be
upgraded to debug. It wasn’t intention to fold as a constant anything at debug level, only
for tracing.
(
https://hibernate.atlassian.net/browse/HHH-17000#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17000#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100233- sha1:62cfdef )