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=cbc0e764eeb1de2be9a79c33c76e2a169b795785;hp=fef91dd1987550eb874fc2313871ae0770c39d31;hpb=0d360ef7b7580ea119e3e2d05dd78962b911df23;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/07_Debugging.pod b/lib/Catalyst/Manual/Tutorial/07_Debugging.pod index fef91dd..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> @@ -372,17 +384,19 @@ tutorial to leave some variables undefined on purpose). Happy debugging. + +You can jump to the next chapter of the tutorial here: +L + + =head1 AUTHOR Kennedy Clark, C Feel free to contact the author for any errors or suggestions, but the best way to report issues is via the CPAN RT Bug system at -. - -The most recent version of the Catalyst Tutorial can be found at -L. +L. -Copyright 2006-2010, Kennedy Clark, under the +Copyright 2006-2011, Kennedy Clark, under the Creative Commons Attribution Share-Alike License Version 3.0 (L).