[slf4j-dev] Review of slf4j

Niclas Hedhman niclas at hedhman.org
Sat May 7 07:46:36 CEST 2005


On Friday 06 May 2005 22:11, Ceki Gülcü wrote:
> In the current code, only a single world needs to be substituted during the
> build process. If LoggerFactory+LoggerFactorAdapter+ImplFA where collapsed
> into LoggerFactory, then the amount of code that would need to be
> substituted at build time would be "large", resulting in a more complicated
> build file.

Really. It doesn't seem so to me. Perhaps because we view it from different 
perspectives, I guess.

IMHO, if you created a separate project for each Logger provider 
implementation, and each one had its own LoggerFactory (big deal), the code 
that currently sits in the FactoryAdapter will instead sit in the 
LoggerFactory itself as private methods, and the four tiny common methods in 
LoggerFactory would call them directly.

Then you don't need any Ant filtering in your sources at all, which should 
make for an easier build system, not a bigger one.


sflf4j
  api
    src/java
      org/slf4j/ULogger.class
      org/slf4j/MessageFormatter.class
  jdk14logging
    src/java
      org/slf4j/LoggerFactory.class
      org/slf4j/Jdk14Logger.class
  log4j
    src/java
      org/slf4j/LoggerFactory.class
      org/slf4j/Log4jLogger.class
  simple
    src/java
      org/slf4j/LoggerFactory.class
      org/slf4j/SimpleLogger.class
  nop
    src/java
      org/slf4j/LoggerFactory.class
      org/slf4j/NopLogger.class

or something like that.


OTOH, "other" implementations can do whatever they like, no need to follow the 
same pattern as you do, right :o)


Cheers
Niclas



More information about the slf4j-dev mailing list