How about this. Then each sub-class has its own logger and it isn't much work.
protected Logger logger_m = Logger.getLogger(getClass());
On 7/21/06, Harp, George <[EMAIL PROTECTED]> wrote:
Hello,
I am used to declaring Loggers in my code the following way
private final static Logger logger_m = Logger.getLogger( MyClass.class
);
A co worker wants do declare loggers from a base class so that each sub
class has a seperate logger
public class BaseClass
{
private Logger logger_m = Logger.getLogger( MyClass.class );
public Logger createLogger( Object baseObject )
{
logger_m = Logger.getLogger( baseObject.getClass( ) );
}
public Logger getLogger( )
{
return( logger_m );
}
}
I feel the second approach is to much effort when the first and "normal"
approach if a 1 liner, but i need to know if there are any ramifications
of the second approach?
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]