From: Egon W. <ego...@gm...> - 2009-07-03 11:16:41
|
Hi Mark, On Thu, Jul 2, 2009 at 12:45 PM, Mark Rijnbeek<ma...@eb...> wrote: > I'm starting to get the applet to work in my local IDE (Jdeveloper) but > I don't see the debug messages anywhere. you need to set the environment variables (params to java): -Dcdk.debugging=true -Dcdk.debug.stdout=true > The applet uses the CDK LoggingTool, but my question is whether that > seems wise. The LoggingTool does not immediately make sense to me - does > it require log4j or can it work without it ? It requires log4j. This has been a choice made a very long time ago, and maybe time to fix this... > If log4j is required, I suppose we should not use it in the applet, > because to make it work we'd have to include a log4j.jar file in the > distribution. I am not sure there is a way around this... the CDK depends on this, quite heavily... But, this is a nice example where we can make the CDK better, driven by JChemPaint needs... > I think I'd personally opt to just use System.out.println(), going > straight to the JRE console window. Probably most convenient, also for > users to trace bugs. I suggest this (major) refactoring in the CDK: 1. replace all use of Logger by an interface ILogger (with the same API) 2. implement ILogger Log4jLogger and SystemOutLogger 3. set up a LoggerFactory to instantiate the Log4jLogger if the log4j library is found, and default to SystemOutLogger if that lib is not found That way, we get: 1. the same behaviour as now for the CDK library 2. allow the applet (or any other application) to not have the log4jar and use STDOUT in that situation (The SystemOut would use System.out and System.err where appropriate) I'll hack up a patch for this now, to make things a bit more concrete... Egon -- Post-doc @ Uppsala University http://chem-bla-ics.blogspot.com/ |