[Catalyst] Constructor's instrumentation
Antoine HULIN
gabuzo at sitadelle.com
Tue Oct 4 15:54:54 CEST 2005
I'd like to see what's going on in a model's constructor (the class is
named Fact::M::Storage). So I added the following statement :
$c->log->info("taratata");
The statement is executed but the script fails later on as shown in the
following trace :
gabuzo at meuh:~/Fact$ ./script/fact_server.pl
[Tue Oct 4 15:09:47 2005] [catalyst] [debug] Debug messages enabled
[Tue Oct 4 15:09:47 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
[Tue Oct 4 15:09:47 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::HTTP"
[Tue Oct 4 15:09:47 2005] [catalyst] [debug] Found home "/home/gabuzo/Devel/Fact"
[Tue Oct 4 15:09:48 2005] [catalyst] [info] taratata
[Tue Oct 4 15:09:48 2005] [catalyst] [debug] Loaded components:
.=----------------------------------------------------------------------------=.
| 1 |
| Fact::C::Reference |
| Fact::C::css |
| Fact::V::TT |
'=----------------------------------------------------------------------------='
Can't call method "isa" without a package or object reference at
/usr/share/perl5/Catalyst/Dispatcher.pm line 387.
Compilation failed in require at ./script/fact_server.pl line 13.
BEGIN failed--compilation aborted at ./script/fact_server.pl line 13.
Line 387 in Dispatcher is the inheritance test in setup_action() :
# We only setup components that inherit from Catalyst::Base
next unless $comp->isa('Catalyst::Base');
I also replaced $c-log->info() with a print statement and got the same
behaviour.
I don't understand why this logging is so disturbing and I'd like to
know what the right way to see what's going on in a constructor is.
Antoine
More information about the Catalyst
mailing list