[Catalyst-dev] Patch: Make -Log Work
David E. Wheeler
david at kineticode.com
Fri Aug 8 04:56:36 BST 2008
On Aug 7, 2008, at 18:48, Matt S Trout wrote:
>> ok !$log->is_warn, 'Warnings should be disabled';
>> ok !$log->is_error, 'Errors should be disabled';
>> ok !$log->is_fatal, 'Fatal errors should be disabled';
>> ok !$log->is_info, 'Info should be disabled';
>> ok $log->is_debug, 'Debugging should be enabled';
>
> That's odd. I think the reasoning is that debug should only turn on
> $c->debug and ensure the $c->log->debug calls go somewhere?
In every other system I've used, log levels were additive. So if I set
it to "warn", I'd get warnings, errors, and fatals. By that logic, if
you set it to debug, you should get everything. But Catalyst::Log
doesn't work that way. Each level is discreet. So I think that whoever
hacked this in was assuming that "debug" would enable everything, and
that's a pretty reasonable assumption, IMHO.
I can easily modify the patch to enable all the log levels. But might
it not be reasonable to also make levels set by the constructor (as
opposed to setting them by enable or disable) additive?
Best,
David
More information about the Catalyst-dev
mailing list