[Catalyst] debug mode
mreece at vinq.com
mreece at vinq.com
Tue Jun 5 04:04:01 GMT 2007
> On Mon, Jun 04, 2007 at 12:55:38PM -0700, Dylan Vanderhoof wrote:
>> Oh, missed this email. Yours looks better than mine. =)
>
> Except for being a performance hit on every single method call on $c
> (there's
> a reason I keep telling people not to make everything a plugin ...).
does *{"$class\::debug"} = sub { 1 }; somehow avoid this performance hit?
or are you talking about the extra call to $c->config?
>> > -----Original Message-----
>> > From: Matthew Pitts [mailto:mpitts at a3its.com]
>> > Sent: Monday, June 04, 2007 8:23 AM
>> > To: The elegant MVC web framework
>> > Subject: RE: [Catalyst] debug mode
>> >
>> >
>> > I wrote a cheap little plugin for my app to override
>> > $c->debug to return
>> > the debug flag from $c->config->{debug}. As such:
>> >
>> > package MyApp::Plugin::DebugMode;
>> >
>> > sub debug {
>> > my $c = shift;
>> >
>> > return $c->config->{debug} || 0;
>> > }
>> >
>> > 1;
>> >
>> > Then I just add a "debug: 1" line to my DEV/QA/UAT configs and make it
>> > "debug: 0" for my PROD config. It's been working pretty well for me.
>> >
>> > Enjoy,
>> >
>> > Matt Pitts
More information about the Catalyst
mailing list