--- Craig Newlander <[EMAIL PROTECTED]> wrote:
> Hello,
> 
>    I'd like to absract log4j from my appilication so I don't have to
> do a
> import org.apache.log4j.* throughout my source files and be dependant
> on the
> Category class.   What is a good method to employ here?
> 
> Craig
> 

I created a wrapper class around Category. You're going to create your
debug(), error(), fatal(), info(), and warn() methods in here. You'll
also need a fully-qualified-classname of the wrapper class. So here's
an example:

class Logger {
  private static final String FQCN = Logger.class.getName();

  public static void debug(Class c, Object message) {
    Category.getInstance(c).log(FQCN, Priority.DEBUG, message, null);
  }

  public static void debug(Class c, Object message, Throwable t) {
    Category.getInstance(c).log(FQCN, Priority.DEBUG, message, t);
  }

  /* Continue wrapping all the others... */
};

-- Don

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to