Plack::Middleware::FirePHP - Middleware for FirePHP::Dispatcher
# app.psgi use Plack::Builder; my $app = sub { my $env = shift; my $fire_php = $env->{'plack.fire_php'}; $fire_php->log('Hello from FirePHP'); $fire_php->start_group('Levels:'); $fire_php->info('Log informational message'); $fire_php->warn('Log warning message'); $fire_php->error('Log error message'); $fire_php->end_group; $fire_php->start_group('Propably emtpy:'); $fire_php->dismiss_group; return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; }; builder { enable 'FirePHP'; $app; };
This is a Plack middleware component which enables FirePHP in your app using FirePHP::Dispatcher. Currently only the basic interface of supported. See The FirePHP::Dispatcher documentation for a list of supported methods.
Please do not call finalize on the FirePHP object yourself. The middleware takes care of that for you.
finalize
To enable the middleware, just use Plack::Builder in your .psgi file:
.psgi
use Plack::Builder; my $app = sub { ... }; builder { enable 'FirePHP'; $app; };
If you want to disable the FirePHP message (eg. for production usage) just set disabled to 1. In this case the middleware will use Class::Null instead of FirePHP::Dispatcher, which will silently dispatch all your calls:
disabled
1
use Plack::Builder; my $app = sub { ... }; builder { enable 'FirePHP', disabled => 1; $app; };
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
http://www.firephp.org, FirePHP::Dispatcher, Class::Null
Florian Helmberger <fh@25th-floor.com>
Tatsuhiko Miyagawa
Copyright 2009 25th-floor - de Pretis & Helmberger KG
http://www.25th-floor.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::FirePHP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::FirePHP
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::FirePHP
For more information on module installation, please visit the detailed CPAN module installation guide.