harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov" <alexei.zakha...@gmail.com>
Subject Re: [classlib] JNDI provider's dependency on logging
Date Tue, 30 May 2006 14:15:07 GMT
> the idea that our classlibraries might yammer out to stdout or logging
> infrastructure to the surprise of the users....

If we use standard logging infrastructure from java.util.logging
package we have powerful mechanism to control the logging process. We
can turn off logging for all components anytime. We can turn it back
anytime. IMHO it does not affect the performance so much. Please look
at the following piece of code from DNS provider:

<DEBUG logging>:
if (LogConst.DEBUG) {
    ProviderMgr.logger.fine("Current question: " + curQuestion.toString());
}

Where LogConst is declared as
public static final boolean DEBUG = true;

While we debug and test our application we have DEBUG variable set to
true. When the application is ready to release we change DEBUG to
false by modifying the source like this:
public static final boolean DEBUG = false;
After doing that Java compiler will not generate any bytecode for
everything between parentheses:
if (LogConst.DEBUG) {
...
// this code will be skipped by the compiler
...
}

However, IMHO we still need to have some non-debug logging (in case
with DNS provider for logging high-level details about provider's
activity). I can't see many benefits in moving this to
System.out.println().
As for avoiding this type of logging completely - this does not seem
to be a good idea IMHO.

2006/5/30, Geir Magnusson Jr <geir@pobox.com>:
> I don't mind the dependency as much as I worry about the performance and
> the idea that our classlibraries might yammer out to stdout or logging
> infrastructure to the surprise of the users....
>
> geir
>
>
> Zakharov, Vasily M wrote:
> > Tim,
> >
> > I see your point of removing extra inter-dependencies between the
> > modules,
> > however I'm surprized by the idea of removing dependencies on Logging.
> >
> > Logging is a package specifically created to organize and structurize
> > logging and debugging output, and I see using it as a good side of
> > implementation
> > of any component, as it provides the capability of having rich and
> > detailed
> > debugging output that can be switched on and off using standard means.
> >
> > Removing logging calls from Harmony components will make those
> > components
> > harder to debug and develop in future. Is it what we want?
> >
> > Vasily Zakharov
> > Intel Middleware Products Division
> >
> >
> > -----Original Message-----
> > From: Tim Ellison [mailto:t.p.ellison@gmail.com]
> > Sent: Tuesday, May 30, 2006 3:51 PM
> > To: harmony-dev
> > Subject: [classlib] JNDI provider's dependency on logging
> >
> > I've just imported the HARMONY-256 contribution of a DNS provider for
> > JNDI into our repository.  That provider introduces a new dependency
> > between JNDI and LOGGING that we didn't have before.
> >
> > IIRC we agreed that we would not scatter logging calls throughout our
> > implementation code, so unless I hear an objection I'll start to unpick
> > that dependency and make JNDI independent of LOGGING.
> >
> > Regards,
> > Tim

-- 
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
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


Mime
View raw message