Anton Luht wrote:
It is possible to remove all calls to logging below a certain level
from .class files using BCEL:
http://surguy.net/articles/removing-log-messages.xml . In this example
logging is removed on fly when class is loaded, but this tool can be
run against class files in the process of building release version.
For example, debug version can contain all logging and release - only
errors. This approach has one disadvantage: it is non-standard and
looks like a dirty hack :)


Yah. I'd rather see us add the logging this way rather than removing it, using annotations or aspects or something... I'll try to experiment with this tomorrow.

I really hate discussing logging. It's impossible to have a short conversation where everyone agrees. Yoko, the CORBA project in the incubator, is going through a very similar issue...

geir

On 31 May 2006 19:24:18 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:
On the 0x17A day of Apache Harmony Alex Blewitt wrote:
> Moral 1: saying 'It's OK, debug logging can be turned off and
> log.debug(msg) is inexpensive' is a lie. If you really feel the need
> for sprinkling debug statements everywhere (and I'm with others in
> using a good IDE to track down problems) then surround every debug
> with if (log.debugEnabled()) { log.debug(msg) }. Yes, it has the same
> effect, but at least you don't bother wasting the calcuation of the
> message itself, and in this case, even a dozy JIT can optimise it
> away.

+1 for log.debugEnabled() :)


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to