in reply to Log::Log4perl and singleton design issue
Or you could wrap this in a class method, so you can inherit it:package Some::Package; our $Log = Log::Log4perl->get_logger(__PACKAGE__);
sub Log { my $class = shift; return Log::Log4perl->get_logger( ref($class) || $class); }
It's probably not good design (and redundant) to explicitly write get_logger("some.logger") everywhere you want to log something - it makes it difficult to change the logger name, for one. If you have a reasonably well structured program, one logger object per package / class is probably enough anyway.
|
|---|