inheritance dilemma

2006-04-14 Thread Jeff Drew
Some code I'm writing runs in two different environments. In one environment, I'm using log4j. In the other environment, the code calls that environment's logging system. Therefore, I need to subclass log4j's Logger so that I can implement an interface required by the other logging system. I have

Re: inheritance dilemma

2006-04-14 Thread Jacob Kjome
You shouldn't be extending Logger, but wrapping it. When you log, pass the fully qualified class name (FQCN) of your wrapper to the logger methods and your line numbers will work just fine. For instance... public class LoggerX implements Log { /* * Constant for name of class to use

Re: inheritance dilemma

2006-04-14 Thread James Stauffer
Other options include using commons logging to allow switching the implementation of making a log4j appender that passes to your other logging system. On 4/14/06, Jeff Drew <[EMAIL PROTECTED]> wrote: > Some code I'm writing runs in two different environments. In one > environment, I'm using log4j

Re: inheritance dilemma

2006-04-14 Thread Jacob Kjome
Whoops, I didn't mean to expose the Logger in the constructor. I meant that to be a Class or a String and then create the logger inside the constructor. Anyway, you get the idea. Jake At 08:34 PM 4/14/2006, you wrote: > >You shouldn't be extending Logger, but wrapping it. When you log, >p