voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
344 stars 138 forks source link

Static logger instaces are sometime inconvenient #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Logger instances are stored in static fields in SubEthaSMTP. This was the 
standard practice (although not with SLF4J), because it is a bit faster and 
requires less memory. On the other hand, it causes inconvenience when using 
JMockit, see http://code.google.com/p/jmockit/issues/detail?id=103 . Static 
loggers are also problematic if the library is shared by more web applications. 

I believe in an IO related library like SubEthaSMTP the performance and memory 
advantages are negligible. I use instance loggers in much finer grained 
objects, without any noticeable effect. If you agree, I prepare a patch which 
converts static to instance log variables.

Original issue reported on code.google.com by hontvari@flyordie.com on 25 Oct 2010 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by lhori...@gmail.com on 2 Nov 2010 at 6:17

trixpan commented 8 years ago

+1 to this. Would be great to be able to design logging