X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FDebugging.pod;h=6aef0e7f3fc84c24131d8eae0be61fd1bc4abe64;hb=6a72d1bf08361c568bb6bd4c86d42016227c9681;hp=125bc3df0baf14942923f5d6eb431b795d6777c9;hpb=8a7c51514fe8828c25ecd353ad2e9dc3b456ac9a;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/Debugging.pod b/lib/Catalyst/Manual/Tutorial/Debugging.pod index 125bc3d..6aef0e7 100644 --- a/lib/Catalyst/Manual/Tutorial/Debugging.pod +++ b/lib/Catalyst/Manual/Tutorial/Debugging.pod @@ -76,19 +76,20 @@ Fans of interactive debuggers. Catalyst is able to easily accommodate both styles of debugging. + =head1 LOG STATEMENTS -Folks in the former group can use Catalyst's C<$c-Elog> facility. -(See L for more detail.) For example, if you add the -following code to a controller action method: +Folks in the former group can use Catalyst's C<$c-Elog> facility. +(See L for more detail.) For example, if +you add the following code to a controller action method: $c->log->info("Starting the foreach loop here"); $c->log->debug("Value of \$id is: ".$id); Then the Catalyst development server will display your message along -with the other debug output. To accomplish the same thing in a TTSite -view use: +with the other debug output. To accomplish the same thing in a TT +template view use: [% c.log.debug("This is a test log message") %] @@ -96,6 +97,7 @@ You can also use L in both Catalyst code (Clog-Edebug("\$var is: ".Dumper($var));)>) and TT templates (C<[% Dumper.dump(book) %]>. + =head1 RUNNING CATALYST UNDER THE PERL DEBUGGER Members of the interactive-debugger fan club will also be at home with @@ -279,7 +281,7 @@ debugging: Check the version of an installed module: - perl -MModule::Name -e 'print $Module::Name::VERSION;' + perl -MEmod_nameE -e '"print $Emod_nameE::VERSION\n"' For example: @@ -305,13 +307,37 @@ Otherwise, it returns undef and nothing will be printed. =back +=head1 TT DEBUGGING + +If you run into issues during the rendering of your template, it might +be helpful to enable TT C options. You can do this in a Catalyst +environment by adding a C line to the C<__PACKAGE__->config> +declaration in C: + + __PACKAGE__->config({ + TEMPLATE_EXTENSION => '.tt2', + DEBUG => 'undef', + }); + +There are a variety of options you can use, such as 'undef', 'all', +'service', 'context', 'parser' and 'provider'. See +L for more information +(remove the C portion of the name shown in the TT docs and +convert to lower case for use inside Catalyst). + +B B (especially the 'undef' option -- leaving this +enabled will conflict with several of the conventions used by this +tutorial to leave some variables undefined on purpose). + + =head1 AUTHOR Kennedy Clark, C Please report any errors, issues or suggestions to the author. The most recent version of the Catalyst Tutorial can be found at -L. +L. Copyright 2006-2008, Kennedy Clark, under Creative Commons License -(L). +(L).