NAME
Plack::Middleware::Debugger::Collector - Middleware for collecting debugging data
VERSION
version 0.03
DESCRIPTION
This middleware orchestrates the interaction between the Plack::Debugger instance and the current request. It sets up the debugger to record the request, fires the begin phase and then calls the PSGI application it wraps. It then goes about calling the after phase using the response_cb callback. If the current request supports the psgix.cleanup extension it will setup things so that the cleanup phase of the debugger can be run followed by the finalization of the debugger session. If psgix.cleanup is not supported it will call the finalization code immediately after the after phase.
METHODS
new (%args)-
This expects a
debuggerkey which contains an instance of the Plack::Debugger. debugger-
This is just an accessor for the
debuggerspecified in the contstructor. call ($env)-
This is just the overriden
callmethod from Plack::Middleware. initialize_request ($env)-
This just delegates to the Plack::Debugger method of the same name.
finalize_request ($env)-
This just delegates to the Plack::Debugger method of the same name.
setup_before_phase ($env)-
This just sets up the
beforephase, which basically just calls theinitialize_requestmethod, followed by therun_before_phasemethod. run_before_phase ($env)-
This just delegates to the Plack::Debugger method of the same name.
setup_after_phase ($env, $resp)-
This just sets up the
afterphase, which basically just returns a callback suitable for passing intoresponse_cb. The callback then just calls therun_after_phasemethod. run_after_phase ($env, $resp)-
This just delegates to the Plack::Debugger method of the same name, and then calls
finalize_requestif there is no support for thepsgi.cleanupextension. setup_cleanup_phase ($env)-
This just sets up the
cleanupphase, which basically just pushes a callback in thepsgi.cleanup.handlersarray, that will call therun_cleanup_phasemethod. Of course it only does this if we have support for thepsgi.cleanupextension. run_cleanup_phase ($env)-
This just delegates to the Plack::Debugger method of the same name, and then calls
finalize_request.
ACKNOWLEDGMENT
This module was originally developed for Booking.com. With approval from Booking.com, this module was generalized and published on CPAN, for which the authors would like to express their gratitude.
AUTHOR
Stevan Little <stevan@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Stevan Little.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.