At 03:54  21/2/01, Rodney Waldhoff wrote:
>>Many projects encapsulate log4j in wrappers. I guess that approach is 
>>similar to option 1. The wrapper is the interface and the underlying 
>>implementation is log4j.
>
>Right on.  The Adapter pattern would seem to serve us well here--we settle 
>on some reasonable standard/conventional logging implementation and code 
>everything to that interface.  Other logging implementations can be used by 
>either sharing that conventional interface, or by providing an adapter that 
>maps the conventinal interface to the "unconventional" one.

Well the most basic adaptor would be

interface LoggerAdaptor
{
  void log( String message );
  void log( String message, Throwable throwable );
}


Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

Reply via email to