[jgroups-dev] Logging and Inheritance
Amin Abbaspour <[email protected]>
| Newsgroups | gmane.comp.java.javagroups.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I believe it's better to define logger in each class rather than using inheritance, i.e.:
private static final Log log = LogFactory.getLog(MyClassName.class);
It's like this in right now (see Protocol.java):
protected final Log log=LogFactory.getLog(this.getClass());
This adds a small bit of code but prevent incorrect line numbers in log.
With current model one may see a message in UDP:896 while logger class is UDP and line number belongs to TP.java.
Of course this means that every log call in TP results in logging via TP logger not the inherited one, which is bearable IMHO.
Regards,
Amin
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Javagroups-development mailing list