That's very cool. Thanks. Though, I'm wondering if going to such lengths for the purpose of injectable loggers is worthwhile. There's the matter of aesthetics, but other than that I'm nearing the conclusion that slf4 static loggers are a better fit considering loggers' special standing.
On Saturday, March 12, 2016 at 3:37:49 AM UTC+2, Tavian Barnes wrote: > > Indeed, as always the constructor is the first thing to run when > constructing an object. > > I did write a library that allows for constructor injection of slf4j > loggers: https://tavianator.com/announcing-sangria/ > > On Friday, 11 March 2016 14:24:57 UTC-5, Roded Bahat wrote: >> >> You're right, the self injection truly makes no sense. >> However, I'm left with the implication that the logger cannot be used in >> constructor code. >> >> On Tuesday, March 8, 2016 at 11:15:58 PM UTC+2, Tavian Barnes wrote: >>> >>> > injecting the singleton instance into itself >>> >>> Why are you doing this? The logger will be injected before the >>> singleton is injected into any *other* object. Just use 'this' instead of >>> self-injecting. >>> >> -- 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 https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/2cae24d9-6337-4fa1-aa8d-1208f5f3bc34%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
