Subject: | Log::Log4perl |
Date: | Tue, 05 Feb 2008 14:35:48 +0100 |
To: | bug-Log-Log4perl [...] rt.cpan.org |
From: | Felix Antonius Wilhelm Ostmann <ostmann [...] websuche.de> |
Log::Log4perl: 1.14
perl: v5.8.8
uname: Linux www1 2.6.17-2-686 #1 SMP Wed Sep 13 16:34:10 UTC 2006 i686
GNU/Linux
i have a problem when i subclass the Log::Log4perl
$other_class->get_logger($category) wont work for other classes then the
__PACKAGE__
} elsif($class ne __PACKAGE__) {
# Called as ::get_logger($category)
this is wrong
$other_class->get_logger($category) result in $class ne __PACKAGE__
this will fix that, but i dont know, perhaps other things will be broken
then:
} elsif($class ne __PACKAGE__ and !defined $args[0]) {
# Called as ::get_logger($category)
##################################################
sub get_logger { # Get an instance (shortcut)
##################################################
my($class, @args) = @_;
if(!defined $class) {
# Called as ::get_logger()
unshift(@args, scalar caller());
} elsif($class eq __PACKAGE__ and !defined $args[0]) {
# Called as ->get_logger()
unshift(@args, scalar caller());
# FIXME
} elsif($class ne __PACKAGE__) {
# Called as ::get_logger($category)
# FIXME
unshift(@args, $class);
} else {
# Called as ->get_logger($category)
}
# Delegate this to the logger module
return Log::Log4perl::Logger->get_logger(@args);
}
--
Mit freundlichen Grüßen
Felix Antonius Wilhelm Ostmann
--------------------------------------------------
Websuche Search Technology GmbH & Co. KG
Martinistraße 3 - D-49080 Osnabrück - Germany
Tel.: +49 541 40666-0 - Fax: +49 541 40666-22
Email: info@websuche.de - Website: www.websuche.de
--------------------------------------------------
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche Search Technology
Verwaltungs GmbH - AG Osnabrück - HRB 200359
Geschäftsführer: Diplom Kaufmann Martin Steinkamp
--------------------------------------------------