Skip Menu |
 

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 32942
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: ostmann [...] websuche.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
X-Virus-Scanned: Clear (ClamAV 0.91.1/5692/Tue Feb 5 08:21:55 2008)
content-type: text/plain; charset="utf-8"; format="flowed"
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 4E6BF4D8143 for <bug-Log-Log4perl [...] rt.cpan.org>; Tue, 5 Feb 2008 08:36:41 -0500 (EST)
Received: (qmail 6454 invoked from network); 5 Feb 2008 13:36:40 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 5 Feb 2008 13:36:40 -0000
Received: from www45.your-server.de (HELO www45.your-server.de) (213.133.104.45) by 16.mx.develooper.com (qpsmtpd/0.40-dev) with ESMTP; Tue, 05 Feb 2008 05:36:29 -0800
Received: from [84.136.138.220] (helo=[192.168.0.27]) by www45.your-server.de with esmtpa (Exim 4.68) (envelope-from <ostmann [...] websuche.de>) id 1JMNxl-0006kr-Aj for bug-Log-Log4perl [...] rt.cpan.org; Tue, 05 Feb 2008 14:35:49 +0100
Delivered-To: cpan-bug+Log-Log4perl [...] diesel.bestpractical.com
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
Subject: Log::Log4perl
Return-Path: <ostmann [...] websuche.de>
X-Original-To: bug-Log-Log4perl [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Date: Tue, 05 Feb 2008 14:35:48 +0100
X-Authenticated-Sender: ostmann [...] websuche.de
X-Spam-Level: *
Message-Id: <47A86634.2020005 [...] websuche.de>
To: bug-Log-Log4perl [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: Felix Antonius Wilhelm Ostmann <ostmann [...] websuche.de>
X-RT-Original-Encoding: ISO-8859-15
Content-Length: 1957
Download (untitled) / with headers
text/plain 1.9k
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 --------------------------------------------------
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.4 required=8.0 tests=ANY_BOUNCE_MESSAGE,BAYES_00,VBOUNCE_MESSAGE
In-Reply-To: <rt-3.6.HEAD-2788-1202218627-264.32942-3-0 [...] rt.cpan.org>
References: <RT-Ticket-32942 [...] rt.cpan.org> <47A86634.2020005 [...] websuche.de> <rt-3.6.HEAD-2788-1202218627-264.32942-3-0 [...] rt.cpan.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Virus-Scanned: Clear (ClamAV 0.91.1/5692/Tue Feb 5 08:21:55 2008)
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id B9D8E4D8004 for <bug-Log-Log4perl [...] rt.cpan.org>; Tue, 5 Feb 2008 09:17:23 -0500 (EST)
Received: (qmail 25970 invoked from network); 5 Feb 2008 14:17:23 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 5 Feb 2008 14:17:23 -0000
Received: from www45.your-server.de (HELO www45.your-server.de) (213.133.104.45) by 16.mx.develooper.com (qpsmtpd/0.40-dev) with ESMTP; Tue, 05 Feb 2008 06:17:18 -0800
Received: from [84.136.138.220] (helo=[192.168.0.27]) by www45.your-server.de with esmtpa (Exim 4.68) (envelope-from <ostmann [...] websuche.de>) id 1JMObi-0002ts-HC for bug-Log-Log4perl [...] rt.cpan.org; Tue, 05 Feb 2008 15:17:06 +0100
Delivered-To: cpan-bug+Log-Log4perl [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #32942] AutoReply: Log::Log4perl
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
Return-Path: <ostmann [...] websuche.de>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Log-Log4perl [...] rt.cpan.org
Date: Tue, 05 Feb 2008 15:17:06 +0100
X-Authenticated-Sender: ostmann [...] websuche.de
X-Spam-Level: *
Message-Id: <47A86FE2.7010504 [...] websuche.de>
To: bug-Log-Log4perl [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: Felix Antonius Wilhelm Ostmann <ostmann [...] websuche.de>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-2788-1202221050-1263.32942-0-0 [...] rt.cpan.org>
Content-Length: 3185
Download (untitled) / with headers
text/plain 3.1k
btw. this would be a nice more magic in the function get_logger: ref($args[0]) and $args[0] = ref($args[0]); # Delegate this to the logger module return Log::Log4perl::Logger->get_logger(@args); } so you can make sub new { ... $self->log->info("initialized"); ... } *log = \&Log::Log4perl::get_logger; Bugs in Log-Log4perl via RT schrieb: Show quoted text
> Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Log::Log4perl", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #32942]. Your ticket is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=32942 > > Please include the string: > > [rt.cpan.org #32942] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-Log-Log4perl@rt.cpan.org > > ------------------------------------------------------------------------- > 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 --------------------------------------------------
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.4 required=8.0 tests=ANY_BOUNCE_MESSAGE,BAYES_00,VBOUNCE_MESSAGE
In-Reply-To: <rt-3.6.HEAD-2788-1202218627-264.32942-3-0 [...] rt.cpan.org>
References: <RT-Ticket-32942 [...] rt.cpan.org> <47A86634.2020005 [...] websuche.de> <rt-3.6.HEAD-2788-1202218627-264.32942-3-0 [...] rt.cpan.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Virus-Scanned: Clear (ClamAV 0.91.1/5692/Tue Feb 5 08:21:55 2008)
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id B0FB44D8119 for <bug-Log-Log4perl [...] rt.cpan.org>; Tue, 5 Feb 2008 09:33:51 -0500 (EST)
Received: (qmail 6383 invoked from network); 5 Feb 2008 14:33:51 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 5 Feb 2008 14:33:51 -0000
Received: from www45.your-server.de (HELO www45.your-server.de) (213.133.104.45) by 16.mx.develooper.com (qpsmtpd/0.40-dev) with ESMTP; Tue, 05 Feb 2008 06:33:46 -0800
Received: from [84.136.138.220] (helo=[192.168.0.27]) by www45.your-server.de with esmtpa (Exim 4.68) (envelope-from <ostmann [...] websuche.de>) id 1JMOre-0004XY-P9 for bug-Log-Log4perl [...] rt.cpan.org; Tue, 05 Feb 2008 15:33:34 +0100
Delivered-To: cpan-bug+Log-Log4perl [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #32942] AutoReply: Log::Log4perl
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
Return-Path: <ostmann [...] websuche.de>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Log-Log4perl [...] rt.cpan.org
Date: Tue, 05 Feb 2008 15:33:34 +0100
X-Authenticated-Sender: ostmann [...] websuche.de
X-Spam-Level: *
Message-Id: <47A873BE.600 [...] websuche.de>
To: bug-Log-Log4perl [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: Felix Antonius Wilhelm Ostmann <ostmann [...] websuche.de>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-2794-1202222037-1518.32942-0-0 [...] rt.cpan.org>
Content-Length: 3435
Download (untitled) / with headers
text/plain 3.3k
sorry, i hate that, but i rewrite the sub get_logger and think that fix all and work faster: sub get_logger { if(@_>=2) { # Called as ->get_logger($category) return Log::Log4perl::Logger->get_logger($_[1]); } elsif(@_==0 or @_==1 && $_[0] eq __PACKAGE__) { # Called as ::get_logger() or __PACKAGE__->get_logger() return Log::Log4perl::Logger->get_logger(scalar caller()); } else { # Called as $other_class->get_logger() or ::get_logger($category) return Log::Log4perl::Logger->get_logger(ref($_[0])||$_[0]); } } Bugs in Log-Log4perl via RT schrieb: Show quoted text
> Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Log::Log4perl", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #32942]. Your ticket is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=32942 > > Please include the string: > > [rt.cpan.org #32942] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-Log-Log4perl@rt.cpan.org > > ------------------------------------------------------------------------- > 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 --------------------------------------------------
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2794-1202222037-1518.32942-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <RT-Ticket-32942 [...] rt.cpan.org> <47A86634.2020005 [...] websuche.de> <rt-3.6.HEAD-2788-1202218627-264.32942-3-0 [...] rt.cpan.org> <47A873BE.600 [...] websuche.de> <rt-3.6.HEAD-2794-1202222037-1518.32942-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-25218-1202590702-1804.32942-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: MSCHILLI [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1009
Download (untitled) / with headers
text/plain 1009b
Yeah, this was a bug in Log4perl, I've just fixed it in CVS, it will be released with 1.15. One caveat is that Log4perl can't tell apart Log::Log4perl::get_logger($cat); and L4pSubclass->get_logger(); and therefore prohibits the latter. I've added documentation for this: Also, note that if you're using a subclass of Log4perl, like package MyL4pWrapper; use Log::Log4perl; our @ISA = qw(Log::Log4perl); and you want to call get_logger() in your code, like use MyL4pWrapper; sub some_function { my $logger = MyL4pWrapper->get_logger(__PACKAGE__); $logger->debug("Hey, there."); } you have to explicitly spell out the category, as in __PACKAGE__ above. You can't rely on # Don't do that! MyL4pWrapper->get_logger(); and assume that Log4perl will take the class of the current package as the category. (Reason behind this is that Log4perl will think you're calling C<get_logger("MyL4pWrapper")> and take "MyL4pWrapper" as the category.)
MIME-Version: 1.0
In-Reply-To: <47A86634.2020005 [...] websuche.de>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <47A86634.2020005 [...] websuche.de>
Message-Id: <rt-3.6.HEAD-25265-1202590745-1696.32942-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 56
Fixed in CVS, to be released with 1.15, thanks! -- Mike


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.