|
From: Rob H. <ro...@ca...> - 2004-11-07 22:14:29
|
Nick, It isn't something that you will use all the time, but flexible log naming is quite useful when using multiple beans of the same time. This isn't a replacement for the private LOG field, it is a complement. Rob Nick Minutello writes: > The other benefit is that it allows you to mock your logger for testing. > > I personally dont often test logging - usually because I am using the > private static final Log LOG = LogFactory.getLog(MyClass.class); and > its a PITA. > > But occassionally, you do want to test that you are logging something > (ie when the logging is important - typically WARN level logging). > > However, that said, I think that the PITA factor for a setter based > dependancy for something as common as logging might outweigh its > benefits.. > (By PITA factor, I am referring to NPE's when you forget to call the > setter in your tests) > > -Nick > > > On Sun, 07 Nov 2004 19:59:12 GMT, Rob Harrop <ro...@ca...> wrote: >> My thinking is that it allows for log names to be changed easily - something >> that is quite handy in apps where you have many instances of the same >> service components lying around. >> >> Rob >> >> >> >> James Cook writes: >> >> > I guess I don't have to use it, but I also think it's a bit overkill. I find >> > this single statement sufficient: >> > >> > private static final Log LOG = LogFactory.getLog(MyClass.class); >> > >> > >> >> -----Original Message----- >> >> Of Dmitriy Kopylenko >> >> >> >> I had the same kind of an idea a while ago and I remember discussing it >> >> with Juergen. At that time Juergen didn't see a real value of injecting >> >> Log instances. >> > >> > >> > >> > ------------------------------------------------------- >> > This SF.Net email is sponsored by: >> > Sybase ASE Linux Express Edition - download now for FREE >> > LinuxWorld Reader's Choice Award Winner for best database on Linux. >> > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >> > _______________________________________________ >> > Springframework-developer mailing list >> > Spr...@li... >> > https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: >> Sybase ASE Linux Express Edition - download now for FREE >> LinuxWorld Reader's Choice Award Winner for best database on Linux. >> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |