On Mon, 17 Dec 2007 20:11:20 +0100 "Maarten Bosteels" <[EMAIL PROTECTED]> wrote:
> Hi David, > > > Some people have feelings stronger than preference about it. Also keep > > in mind: you've got an application. You are not developing a framework. > > > > How would you feel about things if MINA required slf4j AND jcl AND > > log4j? That would seem excessive, would it not? It might even affect > > one's willingness to use the framework. > > Suppose I am developing framework X that depends on projectA, projectB > and projectC > and suppose also that > * projectA requires SLF4J > * projectB requires JCL > * projectC requires log4j > > Then I would take these steps to try to improve the situation: > (1) try (hard) to convince the projectC team to switch to SLF4J > (2) when (1) fails: search an alternative for projectC > (3) try (probably less hard) to convince the projectB team to use > SLF4J instead of JCL > (4) if (3) fails, explain to the users of X why they need both jcl and > SLF4J on their classpath > (5) live with it. My point is, as a framework, MINA should work to avoid imposing this preference upon the consumer of the framework. That's just "friendly" programming practice: make as few assumptions as possible about the user's environment, and impose as few constraints as possible. > So, you would be better off trying to convince the teams of these > non-ASF projects to switch their logging framework ? To SLF4J? I'm not as optimistic about my chances to get a non-ASF project to use an ASF logging framework, as I am that I can convince an ASF project to make their logging optional. > > Therefore I am making an effort to convince the author(s) of these > > frameworks upon which my project relies, to consider making logging > > either configurable with no dependencies, or optional altogether. > > Using JDK logging seems like a reasonable compromise. > > IMO, SLF4J makes logging configurable AND optional (using slf4j-nop.jar). So you need two jars in order to... do nothing. Since logging is already mostly centralized in MINA, why not just have a simple switch of some sort? Even a static method that says "turn off logging" would be better than the current situation. Though e.g. a setter on IoAcceptor and IoConnector (for example) would be ideal (as this also might address the reentrancy problem that Trustin brought up). - DML