logo       
Google Custom Search
    AddThis Social Bookmark Button

[PATCH] Log::Log4perl calls non-existing sub (fwd): msg#00003

Subject: [PATCH] Log::Log4perl calls non-existing sub (fwd)
---------- Forwarded message ----------
From: Jos I. Boumans <kane@xxxxxxxxxx>
To: m@xxxxxxxxxxxxxxx
Cc: chris@xxxxxxxxxxxx
Subject: [PATCH] Log::Log4perl calls non-existing sub

Hi,

Recent versions of SPOPS use your Log::Log4perl module to provide
logging. However,
it sometimes (just under SPOPS it seems) manages to call a coderef that
isn't there.

I've tracked down the problem to Log4perl::Logger around line 690,
where a sub
is installed in the namespace based on a variable that turns out to be
undefined.

Below is a patch that fixes this, by checking if the variable has a
value first.

This makes SPOPS (and our programs on top of it) behave happily again.

Regards,

--
        Jos Boumans

        "Never ask a man what computer he uses. If it's a Mac, he'll
        tell you. If it's not, why embarrass him?" - Tom Clancy

        CPANPLUS        http://cpanplus.sf.net


*** lib/Log/Log4perl/Logger.pm  Mon Aug 16 03:28:11 2004
--- /opt/lib/perl5/site_perl/5.8.3/Log/Log4Perl/Logger.pm       Mon Sep
27 14:34:32 2004
***************
*** 688,694 ****
     # -ms

     *{__PACKAGE__ . "::is_$lclevel"} = sub {
!       $_[0]->{"is_" . $level}->($_[0], "is_" . $lclevel);
     };

     # Add the isXxxEnabled() methods as identical to the is_xxx
--- 688,695 ----
     # -ms

     *{__PACKAGE__ . "::is_$lclevel"} = sub {
!       $_[0]->{"is_" . $level}->($_[0], "is_" . $lclevel)
!         if $_[0]->{"is_".$level};
     };

     # Add the isXxxEnabled() methods as identical to the is_xxx



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>