hibernate-orm
hibernate-orm copied to clipboard
HHH-18204 - Add log level checks
https://hibernate.atlassian.net/browse/HHH-18204
Thanks for your pull request!
This pull request appears to follow the contribution rules.
› This message was automatically generated.
As far as I know, the usual reason we need to use
isDebugEnabled()orisTraceEnabled()is that we're trying to avoid doing work in constructing the log message. If there's no work involved, theisDebugEnabled()call is just superfluous.
Yes, and it also clutters the code. I think we should focus these efforts on hot paths e.g. row reading, find/persist/remove ops.
This was mainly just a quick-and-dirty effort to attempt to get a performance improvement where logging is concerned, as well as perhaps more consistency in checking the log level - right now we are very inconsistent wrt where the debug/trace check is being applied and where it is not, as well as in where debug and where trace is used. With this in mind I think it is better to have the check than not to have it, as far as debug/trace are concerned; wherever the log message is deemed important enough to not have such check is IMHO a candidate for a different log-level, such as INFO. Also in general, I tend to agree with @gavinking in that the vast majority of log msgs in the debug level are completely useless and could prob be removed. If this effort is considered useless, feel free to discard the PR and close the issue.
Closing this since it's been sitting around forever and there doesn't seem to be consensus on its usefulness.