[JBoss-dev] standard for obtaining an org.jboss.logging.Logger instance

2002-01-11 Thread Christian Riege

hi,

is there a standard way of getting the Logger instance in JBoss? the
code is sprinkled with at least 4 different ways of doing so, i.e.
sometimes its a private variable, sometimes its protected, sometimes its
on a package level access, sometimes its declared as 'final', etc ...
how about agreeing on a standard way; that would clean up some
confusion.

regards,
christian


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] standard for obtaining an org.jboss.logging.Logger instance

2002-01-11 Thread Adrian Brock

extends org.jboss.system.ServiceMBeanSupport :-)

It's protected there.

Regards,
Adrian
__
View this jboss-dev thread in the online forums:
http://jboss.org/forums/thread.jsp?forum=66thread=6964

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] standard for obtaining an org.jboss.logging.Logger instance

2002-01-11 Thread Jason Dillon

It really depends on the class it will be used in.  For classes which
you expect to be subclasses and where the base class should use the
derived classes category, then a protected final Logger created on
construction would be used.

If you want the base class and the derived class to have separate
logging, or rather logging for that class only, then a private static
final Logger would be used.  The private keeps other classes from using
it unintentionally and the final keeps it from being replaced (which you
almost never want to do to one of these).

The difference between package private and private could be laziness on
the coders part, or could be that the logging data is shared between
subclasses in the given package only.  I would guess it was laziness.

The usage of final is debatable, but I feel that it is useful to avoid
simple assignment errors and to have a bit more insurance that Loggers
won't get null'd or re-categorized.

In short, there are a several different ways to get a Logger because the
Logger usage varies slightly from class to class.

Use the appropriate method for the logging your class needs.

--jason


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:jboss-
 [EMAIL PROTECTED]] On Behalf Of Christian Riege
 Sent: Friday, January 11, 2002 3:54 AM
 To: [EMAIL PROTECTED]
 Subject: [JBoss-dev] standard for obtaining an
org.jboss.logging.Logger
 instance
 
 hi,
 
 is there a standard way of getting the Logger instance in JBoss? the
 code is sprinkled with at least 4 different ways of doing so, i.e.
 sometimes its a private variable, sometimes its protected, sometimes
its
 on a package level access, sometimes its declared as 'final', etc ...
 how about agreeing on a standard way; that would clean up some
 confusion.
 
 regards,
   christian
 
 
 ___
 Jboss-development mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-developmen


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: RE: [JBoss-dev] standard for obtaining an org.jboss.logging.Logger instance

2002-01-11 Thread Adrian Brock

final is good, it gives the hint to the JIT that
it won't change, so
log.info() can be inlined
private helps with this as well, no need for
polymorphism!

Regards,
Adrian
__
View this jboss-dev thread in the online forums:
http://jboss.org/forums/thread.jsp?forum=66thread=6964

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development