Re: debug mode

Frank Meissner <[email protected]>
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
masukomi wrote:
> two ideas...
> 
> 1) why not have SwingEngine.DEBUG_MODE be mutable.

Yes, I definetly agree with you. It should'nt have any side effects and 
gives the user a clue about what was wrong during development. On final 
shipment, the debug is turned off.

<offtopic>
We could even write a custom tag doing this ;)
</offtopic>

> 2) what about modifying it so that instead of it writing to system out 
> you give it a listener for logging. By default there would be a simple 
> listener that just went to System.out but users could optionally write  

No, not System.out This is buffered and you get the debug output if in 
order but not on time (and if you are using System.err, the order gets 
mixed up)

> a listener that would shunt the output to Log4J or whatever their 
> favorite logging package was.

Hm, one of the two log4j or logkit supported listeners for just that.

> 
> my only question on 2 is if it should support multiple listeners or just 
> one.

Usually one is enough. If you want more, just write a listener who acts 
as a t-piece and supports multiple listeners as proxy.

Just my two cents...

Frank
> 
> 
> I think it cold work as follows... if in debug mode it ships it off to a 
> class that passes it off to the listeners. If there aren't any listeners 
> registered the first time it would add in the default one.
> 
> 
> 
> -Kate
> 
> 
> _______________________________________________
> Forum mailing list
> [email protected]
> http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.