[Catalyst] Why does $c->stats require -Debug flag?
Jon Schutz
jon+catalyst at youramigo.com
Thu Apr 10 23:21:44 BST 2008
On Thu, 2008-04-10 at 19:51 +0100, Matt S Trout wrote:
> On Thu, Apr 10, 2008 at 05:02:26PM +0100, Richard Jones wrote:
> > I've just tried to run my app. without the -Debug flag and now I just
> > get the '(en) Please come back later' (+ several other languages) error
> > page. I've traced it to the use of $c->stats in the end() method in the
> > Root controller, which is an ActionClass('RenderView') method:
> >
> > [error] Caught exception in MyApp::Controller::Root->end "Can't call
> > method "accept" on an undefined value at ... etc
> >
> > $c->stats->accept() is used in generating script timing reports (Cory
> > Watson: Adding Action Timings To Your Output), and works fine if -Debug
> > is enabled.
> >
> > Nothing else seems adversely affected by removing -Debug.
> > Catalyst::Stats is up to date, and the docs suggest it should
> > automatically be accessible via $c->stats. Any ideas anyone?
>
> Debug mode is what turns on the internal statistics and action timing code,
> so the stats object isn't initialised without it.
>
> I'm not sure if this is a bug or a feature.
>
>From the perldoc for 5.7012 -
"Stats collection is enabled when the '-Stats' options is set, debug is
on or when the <MYAPP>_STATS environment variable is set."
So, if you want stats but not debug, use -Stats instead of -Debug.
--
Jon Schutz My tech notes http://notes.jschutz.net
Chief Technology Officer http://www.youramigo.com
YourAmigo
More information about the Catalyst
mailing list