Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: andreas1234567 [...] hotmail.com
Cc:
AdminCc:

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



Subject: croak on non-numeric additivity in Logger.pm
OS: Linux 2.4.20-28 i686 PERL: This is perl, v5.6.1 built for i386-linux Module: Log::Log4perl INST_VERSION 0.51 This is not really a bug, just a feature to prevent additivity to be set improperly. When using a file to set config for Log4perl, I happen to add ';' at end-of-line, which is unfortunate when setting additivity: log4perl.additivity.foo = 0; # <-- TRUE, not false as intended The above statement will set additivity to true for this logger, which is the exaxt opposite of what I intended. That's why I suggest adding a croak (or possibly a carp) on non-numeric additivity. Please withhold my email and name, I do not wish for publicity. Best regards, Andreas Falck Oslo, Norway --
508a509 > croak "additivity $onoff isn't numeric" if ($onoff =~ /\D/);
[guest - Wed Mar 16 03:46:43 2005]: Show quoted text
> log4perl.additivity.foo = 0; # <-- TRUE, not false as intended > > The above statement will set additivity to true for this logger, which > is the exaxt opposite of what I intended. > > That's why I suggest adding a croak (or possibly a carp) on > non-numeric additivity.
Hi Andreas, thanks for your patch. Clearly, the behaviour you're seeing is undesirable. However, your patch doesn't take into account that the right side of the assignment can be a string ("true"/"false") or even a subroutine returning a value ("sub { return $something }"). I don't see an easy and conclusive way to fix this. If you do, please let me know. Thanks! -- Mike