|
From: Martin J. E. <mar...@ea...> - 2011-11-01 14:13:35
|
Hi,
Is this really the intended behaviour:
perl -w -le 'use strict;use warnings;use Log::Log4perl qw(get_logger); my $lh = get_logger("BET::Data::Remove"); $lh->debug("fred");$lh->logwarn("warning from l:l"); warn("warning");'
Log4perl: Seems like no initialization happened. Forgot to call init()?
warning at -e line 1.
i.e., if something does not call init for Log::Log4perl but has a log handle when logwarn is called a warn does not happen?
So substituting warn with logwarn does not always warn!
I spent some time debugging a problem this morning only to discover this. I find this most worrying as I'd expect the warn to happen whatever. If you substitute logdie for die it seems to work.
perl -MLog::Log4perl -le 'print $Log::Log4perl::VERSION;'
1.33
This is perl, v5.10.1 (*) built for i686-linux-gnu-thread-multi
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
|