[Catalyst] Selective debug output
Christopher H. Laco
claco at chrislaco.com
Wed Nov 7 13:46:48 GMT 2007
J. Shirley wrote:
> On Nov 6, 2007 5:47 PM, Jonathan Rockway <jon at jrock.us> wrote:
> =
>> Joe Landman wrote:
>>> How do I selectively enable or disable debugging output?
>>> Specifically, FormBuilder debugging output is simply far to verbose to
>>> be meaningful to us. I suppose I could simply pass in a debug=3D>0 when
>>> I create the form. Is there any global way?
>>>
>>> FWIW: I only want to surpress formbuilder output during debug.
>> Unfortunately there is no way to do what you want. Most of the plugins
>> (etc.) just check $c->debug to see whether or not to log via
>> $c->log->debug. I suggest a filter in a custom log class (just regex
>> the formbuilder crap out), or fixing the plugins/controllers to check
>> $c->config->{pluginname_debug) or something. Maybe we can make this
>> easier in 5.8; suggestions welcome.
>>
>> Regards,
>> Jonathan Rockway
>>
>>
>>
>>
>>
> I would prefer something like:
> MyApp->config(
> 'PluginName' =3D> { debug =3D 0 }
> );
> =
> Thoughts?
> =
> =
> =
> ------------------------------------------------------------------------
> =
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.or=
g/
> Dev site: http://dev.catalyst.perl.org/
On a somewhat related note.
While writing REST tests thius weekend, I set CATALYST_DEBUG=3D0, yet
C::A::REST insisted on debugging anyway. I guess I never realized that
you always have to check $c->debug first, and assumed $c->log->debug
would go to the bit bucket if CATALYST_DEBUG was false.
In my case, I just cheated, and had MyApp::debug do the check first to
squelch all of the non believers.
-=3DChris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071107/ce77=
3b29/signature.pgp
More information about the Catalyst
mailing list