On 10/29/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Mikhail Fursov wrote:
> On 10/29/06, *Geir Magnusson Jr.* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>     1) The Logging Debate That Won't Die - we don't want to encumber our
>     "production" code with logging or even with runtime enablement checks
>     for logging i.e.
>
>           if (logging.isDebugEnabled())
>
>     but it's clear that some people still want to use it for debugging.
>
>
> Just a small idea: Let teach JIT to purge this code unless special option is 
ON
> ? Doing this we solve performance issue at least .

Well, then we have a classlibrary that is only good for use with JIT's
that have been specially trained to find code that looks like very
common code for logging implementations.

The results could be hilarious, actually.

This particular use case seems like inserting breadcrumbs for
non-interactive debugging. My preference here would be use AOP via
special compile or just java.lang.instrument transformation.


>
>     If we did this, I assume that our build becomes a two step process,
>     first pre-process the code to create  separate "buildable source", which
>     would go into source jars and such for debugging purposes.  Then our
>     current javac/jar process.
>
>     I'd also like to be able to work in an IDE with the pre-proc stuff
>     invisible if possible...
>
>
> This is the main problem. Backporting of
> your changes from the "buildable source" to the "source with
> preprocessor" could have more overhead then support of a separate branch
> for different Java version.

No - you'd edit the original source directly - you wouldn't edit the
pre-processed source.

But a plugin would let you flip between original and processed...

geir

Could some of this be done via annotations and a specialized
annotations processor? Annotations could be utilized along with a
java.lang.instrument transformer tool. A JIT could also look for
annotations in class files and add special behavior, but the classlib
would be runnable without these behaviors.

Harmony will need some form of an APT eventually and annotations
wouldn't require specialized IDE plugins.

-Nathan


>
>
>
>
> --
> Mikhail Fursov

Reply via email to