On Thu, 30 Sep 2004, Keith Hatton wrote:

| Hi Michael,
|
| I haven't had any direct experience of the type you describe, but I have a couple of 
thoughts:
|
| 1. If you're using Java 1.4, you might be able to examine the stack
| trace programatically, and not call any logging in your toString() if
| you realise that you're already in a logging call.

You could also use a static ThreadLocal for the toString() scenario: count
up for each time you go into a toString() method, then count down before
exiting, only log if it starts out 0 - this should be faster..
  But I do agree: what good can come out of logging toString()
invocations?!

Endre


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to