Maypole::Plugin::Trace - trace calls in Maypole
use Maypole::Application qw/Trace/; # options: __PACKAGE__->trace_level(3); __PACKAGE__->only_trace_exported(1);
Prints a trace of method entries and exits to STDERR.
STDERR
Requires the latest version of Maypole in SVN, or 2.11 when it's released.
__PACKAGE__->trace_level(1);
The default trace_level is set to 2.
trace_level
The trace level must be set before calling setup.
setup
Level Output ====================================================================== 0 none 1 method entry and exit 2 as above, but prints method arguments and return values 3 uses Data::Dumper to expand method arguments and return values within Exported methods 4 uses Data::Dumper to expand method arguments and return values within all methods 5 as 2, but also reports private methods (single leading _ in name) 6 as 3, but also reports private methods (single leading _ in name) 7 as 4, but also reports private methods (single leading _ in name)
Tracing is implemented for packages in the Maypole namespace, and in your application's namespace.
The characters E: are printed in the left margin to indicate when an exported method is being processed.
E:
At trace level 2, objects, e.g. in class Foo, are represented as Foo(OBJECT). This is to avoid potential overloaded stringification, which causes deep recursion errors.
Foo
Foo(OBJECT)
Note: trace output is only generated for exported methods when they are called via Maypole's own controller mechanism. So, for example, if a custom method directly calls an exported method, the entry to and exit from the exported method will not be registered in the trace output. This is a known bug, suggestions for how to fix it would be great.
__PACKAGE__->only_trace_exported(1)
Turn off tracing except within Exported methods. Default is 0 - trace all methods.
__PACKAGE__->extra_trace_classes('Some::Problem::Package'); # or __PACKAGE__->extra_trace_classes( [ 'Some::Problem::Package', 'Another::Buggy::Monster', ] );
Adds the specified package(s) to the list of traced packages.
True or false, default false.
Shows the request path in trace output.
No path is shown for methods that do not include the Maypole request object in their parameters. This includes methods run before or after a request, most methods in non-Maypole packages, and some methods within the Maypole stack. Also, the path is not available until after parse_path() has returned.
parse_path()
Configures tracing.
David Baird, <cpan@riverside-cms.co.uk>
<cpan@riverside-cms.co.uk>
Please report any bugs or feature requests to bug-maypole-plugin-trace@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Maypole-Plugin-Trace. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-maypole-plugin-trace@rt.cpan.org
Copyright 2005 David Baird, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Maypole::Plugin::Trace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Maypole::Plugin::Trace
CPAN shell
perl -MCPAN -e shell install Maypole::Plugin::Trace
For more information on module installation, please visit the detailed CPAN module installation guide.