On Tue, 1 Nov 2011, Martin J. Evans wrote:

> So substituting warn with logwarn does not always warn!

That's an interesting case. The way it's implemented right now is that
logwarn() will only call warn() (along with other log4perl actions) if
the log level is greater or equal than WARN.

logdie(), on the other hand, will call die() unconditionally, because
it's an action, not only a message.

-- -- Mike

Mike Schilli
m...@perlmeister.com

> 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?
>

>
> 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
>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to