Name : perl-Plack-Middleware-Debug
| |
Version : 0.180.0
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.1.1
| Date : 2024-07-28 00:01:11
|
Group : Unspecified
| Source RPM : perl-Plack-Middleware-Debug-0.180.0-lp155.1.1.src.rpm
|
Size : 0.17 MB
| |
Packager : https://www_suse_com/
| |
Summary : Display information about the current request/response
|
Description :
The debug middleware offers a configurable set of panels that displays information about the current request and response. The information is generated only for responses with a status of 200 (\'OK\') and a \'Content-Type\' that contains \'text/html\' or \'application/xhtml+xml\' and is embedded in the HTML that is sent back to the browser.
Note that the code is injected *directly before the closing tag* (\'< /body>\') so if there is no such tag, the debug panel will not be injected at all.
To enable the middleware, just use Plack::Builder as usual in your \'.psgi\' file:
use Plack::Builder;
builder { enable \'Debug\', panels => [ qw(DBITrace Memory Timer) ]; $app; };
The \'Debug\' middleware takes an optional \'panels\' argument whose value is expected to be a reference to an array of panel specifications. If given, only those panels will be enabled. If you don\'t pass a \'panels\' argument, the default list of panels - \'Environment\', \'Response\', \'Timer\', \'Memory\', \'Session\' and \'DBITrace\' - will be enabled, each with their default settings, and automatically disabled if their target modules or middleware components are not loaded.
Each panel specification can take one of three forms:
* A string
This is interpreted as the base name of a panel in the \'Plack::Middeware::Debug::\' namespace, unless preceded by \'+\', in which case it\'s interpreted as an absolute name similar to how Plack::Builder handles such names, e.g. \'+My::Plack::Middleware::Debug::Something\'.
The panel class is loaded and a panel object is created with its default settings.
* An array reference
If you need to pass arguments to the panel object as it is created, you may use this form (But see below).
The first element of the array reference has to be the panel base name. The remaining elements are key/value pairs to be passed to the panel.
For example:
builder { enable \'Debug\', panels => [ qw(Environment Response Timer Memory), [ \'DBITrace\', level => 2 ] ]; $app; };
Because each panel is a middleware component, you can write this way as well:
builder { enable \'Debug\'; # load defaults enable \'Debug::DBITrace\', level => 2; $app; };
Note that the \'< enable \'Debug\'\'> line should come before other Debug panels because of the order middleware components are executed.
* Custom middleware
You can also pass a Panel middleware component. This might be useful if you have custom debug panels in your framework or web application.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/15.5/noarch |