The problem of abusing the predicate by performing anything other than
logging inside it.

You cannot get rid of the predicate without introducing side effects as
I've demonstrated throughout this thread.
On Apr 4, 2012 6:01 AM, "Marco Schulze" <marco.c.schu...@gmail.com> wrote:

> Which problem is solved? There's still a predicate there.
>
> On 03-04-2012 20:49, Zlatin Balevsky wrote:
>
>> May I suggest a nice little script someone ( novice? ) could write,
>> solve the logging problem and learning a thing or two about language
>> theory in the process :
>>
>> Transform:
>> ====
>> if (LOG.isLoggable(Level.DEBUG)) {
>>       <some complex computation that wouldn't happen otherwise>
>>       <log results of complex computation, maybe other stuff too>
>> }
>> ====
>> Into
>> ====
>> private static void logComplexComputation( .. arguments! .. ) {
>>    <  do the stuff above>
>> }
>>
>> if (LOG.isLoggable(Level.DEBUG)) {
>>     logComplexComputation( .. arguments ..);
>> }
>> ====
>>
>> This gets run as pre-commit hook and the problem is solved with
>> positive run-time side effects.
>>
>>
>> On Sun, Mar 25, 2012 at 6:22 PM, Marco Schulze
>> <marco.c.schu...@gmail.com>  wrote:
>>
>>> Working (but incomplete) code is available @
>>> https://github.com/Heiral/**fred-staging/tree/logger++<https://github.com/Heiral/fred-staging/tree/logger++>
>>> ______________________________**_________________
>>> Devl mailing list
>>> Devl@freenetproject.org
>>> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>>>
>> ______________________________**_________________
>> Devl mailing list
>> Devl@freenetproject.org
>> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>>
> ______________________________**_________________
> Devl mailing list
> Devl@freenetproject.org
> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>
_______________________________________________
Devl mailing list
Devl@freenetproject.org
https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to