mschilli/log4perl — Issue #12: logwarn / error_warn / logcarp / logcluck don't warn unless log level is turned up
Author: Potatohead
Created: 2011-12-23 04:27:52+00:00
State: open

Hi,

So I came across this when I tried to use log4perl without initializing it (I wanted warnings and deaths, and when the modules user was using log4perl it all to be logged as well). The logdie and associated methods all die regardless of log level but the warn versions all require log4perl to be configured to log the message of that level before it will issue the warn statement. This seems wrong to me as I thought the intention of these methods was was to log your warnings as opposed to warn your log messages.

Originally I was just going to fork and put in a pull request for this and let that be accepted or rejected, but after I started working on it I found that t/024WarnDieCarp.t explicitly tests for the warnings not being made when the log level isn't high enough, so now I'm thinking this is intended behavior and just a really odd design decision.

So I'm keen to have a version of logwarn that warns regardless of log levels or initialization either by repairing the existing methods or implementing some new methods. I'm eager to do the work for either solution if you guys are happy to see either implemented.

So let me know whether either of these is ok or if I'm just confused.

Thanks
-Chris