X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F07_Debugging.pod;h=99372740de6cecd7aafc09eb70157c8f31611a1d;hb=be3349e1a2966ee8abc15c1b9a168a3c70125ccb;hp=25b56abdf73b8f645418b40d3c52b41423ce76e6;hpb=bb0999d3922361836e0b2696d466ab3cb130bba1;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/07_Debugging.pod b/lib/Catalyst/Manual/Tutorial/07_Debugging.pod index 25b56ab..9937274 100644 --- a/lib/Catalyst/Manual/Tutorial/07_Debugging.pod +++ b/lib/Catalyst/Manual/Tutorial/07_Debugging.pod @@ -59,6 +59,12 @@ L This chapter of the tutorial takes a brief look at the primary options available for troubleshooting Catalyst applications. +Source code for the tutorial in included in the F +directory of the Tutorial Virtual machine (one subdirectory per +chapter). There are also instructions for downloading the code in +L. + + Note that when it comes to debugging and troubleshooting, there are two camps: @@ -103,9 +109,15 @@ severity/importance): $c->log->error $c->log->fatal -You can also use L in both Catalyst code -(Clog-Edebug("\$var is: ".Dumper($var));)>) -and TT templates (C<[% Dumper.dump(book) %]>. +You can also use Data::Dumper in both Catalyst code and in TT templates. +For use in Catalyst code: + + use Data::Dumper; + $c->log->debug("\$var is: ".Dumper($c->stash->{something})); + +and TT templates: + + [% USE Dumper ; Dumper.dump(c.stash.something) %]. B Whether you are a logging fanatic or not, we strongly recommend that you take advantage of L or L. It's @@ -179,7 +191,7 @@ in. Once the breakpoint is encountered in the C method, the console session running the development server will drop to the Perl debugger prompt: - MyApp::Controller::Books::list(/root/MyApp/script/../lib/MyApp/Controller/Books.pm:48): + MyApp::Controller::Books::list(/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm:48): 48: $c->stash->{books} = [$c->model('DB::Book')->all]; DB<1> @@ -191,7 +203,7 @@ C into methods/subroutines): DB<1> n SELECT me.id, me.title, me.rating, me.created, me.updated FROM book me: - MyApp::Controller::Books::list(/root/MyApp/script/../lib/MyApp/Controller/Books.pm:53): + MyApp::Controller::Books::list(/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm:53): 53: $c->stash->{template} = 'books/list.tt2'; DB<1>