harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib] logging (was: Re: [classlib][xnet] Problem connecting using SSLSocketImpl)
Date Wed, 18 Oct 2006 08:53:15 GMT
Mikhail Loenko wrote:
> 2006/10/17, Alexander Kleymenov <kleymenov@gmail.com>:
> Hi Tim
>> BTW, there are some logging capabilities in JSSE provider. You can 
>> turn them on by specifying -Djsse=record,prf,socket as an option to
>> VM. Log output could be useful in problem analysis.
> You asked why we need logging. Now we have an example.

I maintain that we should not be putting printf's (i.e. calls to
logging) in the Java code.

We are running on a virtual machine that knows everything about the
executing code, what methods are being invoked, the actual arguments,
the state of the stacks and the heap, etc.  There is much more value in
a good trace story built into the VM than having developers decide a
priori where the problems are going to be.

By adding logging calls you have a much more significant effect on the
code base, you hit performance, modify the stack to log the messages,
bloat the code for readability, and by definition introduce more bugs
and maintenance overhead.

If you do want to inject application-level tracing then I'd go for
aspects, which are designed specifically to provide such orthogonal
behavior to the classlib functionality.

If you look here[1] there is a document that describes the diagnostics
capabilities in the IBM VM that we use to support our customers.

[1] http://www-128.ibm.com/developerworks/java/jdk/diagnosis/



Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message