logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre StĂžlsvik <En...@stolsvik.com>
Subject Re: isFatalEnabled()?
Date Fri, 15 Jun 2007 13:35:43 GMT
Bret Schuhmacher wrote:
> There are methods for isDebugEnabled and isInfoEnabled, but how do you
> check for isFatalEnabled or any of the other levels? I've used
> isEnabledFor(Priority.<level>), but Priority.FATAL and the rest are
> deprecated, so what's the best way to test for the unrepresented
> is<Level>Enabled levels?

There is isTraceEnbled too.

Just don't bother to test for them externally - they are always checked 
for inside log4j at any rate. It is assumed that there are rather few 
warnings, errors and fatals throughout an application, and that they 
mostly won't be turned off anyway, thus there isn't much need for the 
isEnabled methods. Those methods are only there to enable 
argument-construction bypass - that is, not having to actually make the 
log-message if logging for the particular level is turned off.


To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message