logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: HOw to replace the system.out.println
Date Tue, 02 Sep 2008 17:42:31 GMT

On Sep 2, 2008, at 12:36 PM, Thorbjørn Ravn Andersen wrote:

> Curt Arnold skrev  den 02-09-2008 19:01:
>> The suggestion introduces SLF4J into the mix with explanation and  
>> goes  through a lot of effort to evaluate the class of the calling  
>> statement for categorization when the cost might be excessive.  It  
>> would seem that if you replaced the System.println(...) with a call  
>> to something like:
> There are many ways to skin a cat.
> Your suggestion is simple but throws away all location information.   
> My suggestion is more complex (admitted, the slf4j was a spinal  
> reflex in the material I dug up for this) and slow, but keeps  
> location information

I believe you could still extract it if you wanted it, but it keeps it  
all in one place and you can decide if you want to go to that  
expense.  You could also check the threshold of the logger hierarchy  
before attempting to determine the location.
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message