It is Logger specific, Lloyd.
When you "are" debugging, you set that logger's level to "FINE", do the
action and reset it back.
BTW, are you saying that FINE level log records should not be debug
information?
Lloyd L Chambers wrote:
> Logging is problematic with FINE, because multiple megabytes of crud
> spews out, hiding items of interest.
>
> That's why I never use logging for debugging. True debugging is not
> appropriate for the log IMO.
>
> Lloyd
>
> On May 4, 2007, at 11:01 AM, Kedar Mhaswade wrote:
>
>>
>>
>> Bill Shannon wrote:
>>> Kedar Mhaswade wrote:
>>>>
>>>>>> - boolean debug = false;
>>>>>> + final boolean debug = false;
>>>>>
>>>>> There doesn't seem to be any actual use of debug, why not just
>>>>> remove it?
>>>> I agree. Plus there is no way to debug the code without actually
>>>> recompiling code
>>>> with this variable set to true.
>>>>
>>>> A better way to do this is: private final boolean debug =
>>>> Boolean.getBoolean("debug");
>>>>
>>>> Unfortunately, we have this pattern in code at several places ...
>>>
>>> Shouldn't that generally be replaced by use of a Logger?
>> I agree. All printlns can be effectively replaced by
>> e.g. Logger.getLogger(adminLogger).fine("a debug statement");
>>
>> But I have read that this should be preceded by
>> Logger.isLoggable(Level.FINE) and we are lazy :(
>>
>> Actually, it makes a lot of sense to use Logger because changes to
>> the logging levels of a logger are
>> dynamic. So, you can easily make a logger log records at "FINE" even
>> if its initial level is "INFO".
>> This is a significant GlassFish feature.
>>
>> In spite of all this, system.out.printlns are way more popular with
>> GlassFish developers :)
>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>