Comment #6 on issue 269 by philippe.beaudoin: Move Logger binding out to LoggerModule, so users can bind their own Loggers
http://code.google.com/p/google-guice/issues/detail?id=269

@Sam Sorry for waking this zombie up, but your workarounds are not really satisfying for cases where Guice is used to inject a class during unit testing. Asking all the users to forego Logger injection and force them to inject some custom logging interface/factory is incompatible with the desire of a injection-testing framework to act transparently on top of existing code. At the same time, it's important to be able to mock-out or replace logging code during unit testing.

For a concrete example, I'm running into this problem with Jukito:
  http://code.google.com/p/jukito/issues/detail?id=9

IMHO, non-rebindable built-in bindings pose a very important limitation for a use case (unit testing) that DI is supposed to specifically help resolve. Therefore I would really love to get some hook inside of Guice to switch the bound Logger. It doesn't have to be easy to do, but it really does sound impossible to do without some internal support from your side.

Also, I'm happy to work on a patch if you think it's appropriate.


--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to google-guice-dev@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to