Hi Bram, at Apache we have the Apache Onami[1] project which focuses on Guice extensions - one of them is Apache Onami-Logging[2] which does that work for you. Apache Onami-Logging release is currently under vote in the Incubator, so it will soon be available. HTH, -Simo
[1] http://onami.incubator.apache.org/logging/ [2] http://onami.incubator.apache.org/logging/ http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Wed, Jan 23, 2013 at 11:54 AM, Bram <[email protected]> wrote: > Im working on implementing Guice in some existing code. I use log4j2 as > logger in that code, so I implemented an injector using this example: > http://code.google.com/p/google-guice/wiki/CustomInjections > > I'm injecting my logger in the following way: > > clas Test { > @InjectLogger > private Logger logger; > } > > This works perfectly, however all of my unit tests break because of logging > statements in the code and no logger injected (thus: nullpointer exception). > Ofcourse I understand why this is, but I dont know the best way to solve > this. > > I can obviously add a setter for the logger that I call in my unit test > set-up, but is that realy a proper solution? > > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > Visit this group at http://groups.google.com/group/google-guice?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
