RFR: 8024525 - Make Logger log methods call isLoggable()

Alan Bateman Alan.Bateman at oracle.com
Thu Sep 12 08:40:39 UTC 2013

On 11/09/2013 18:59, Daniel Fuchs wrote:
> Hi,
> Please find below a changeset for a small logging RFE:
> 8024525 - Make Logger log methods call isLoggable()
> <http://cr.openjdk.java.net/~dfuchs/webrev_8024525/webrev.00/>
> This change makes the various Logger logging method call isLoggable()
> instead of simply inlining the checks.
> This should make the life easier for subclasses of Logger which
> want to control when messages should be logged.
> The test is a bit obscure but it calls all the methods
> that have been modified and checks that they log when isLoggable()
> is true and don't log when isLoggable() is false.
The update to Logger looks okay to me.

I think the test could benefit from a comment to more fully explain why 
it checks that isLoggable has been called (as you say, the test is a bit 
obscure). A minor comment is that "levels" should probably be in 
uppercase. Also I assume the commented-out debug message in publish 
isn't needed.


More information about the core-libs-dev mailing list