logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorbjørn Ravn Andersen <thunderax...@gmail.com>
Subject Re: HOw to replace the system.out.println
Date Tue, 02 Sep 2008 17:36:28 GMT
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

The stack trace investigation is necessary when doing a simple 
text-replace as you do not know if you are inside a static method. 

Perhaps a long term effort in this regard, could be developing an 
Eclipse/Netbeans/Whatever refactoring template which converts 
System.out/System.err references to log statements?

-- 
  Thorbjørn Ravn Andersen          "... plus... Tubular Bells!"


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


Mime
View raw message