Auto injecting logger with guice
- by koss
With reference to Guice's custom injections article, its TypeListener performs a check for InjectLogger.class annotation - which can be optional. Removing that check will inject to all Logger.class types.
class Log4JTypeListener implements TypeListener {
public <T> void hear(TypeLiteral<T> typeLiteral, TypeEncounter<T>…