Rhesa,

This is too cool!  I can think of all sorts of uses for this.  For
instance, it would be very useful to have a simple
logger/dumper/debugger plugin that lets you dump the app state at
various points in the app's life cycle.

One of the problems that I often have is that the $self object is so big
that it's pretty pointless to dump it to the error log.  But a
browseable version of the $self object using the DHTML-based folding
tricks that you use for reports would be very useful.

Regarding the timings plugin I have a couple of suggestions:

 * the name of the current template is available to the load_tmpl hook -
   it would be nice if this were displayed in the report (useful when
   there are a a lot of templates filled in a single request)

 * the Timing module could register its own cgiapp hook - something like
   'devpopup_timings'.  Then the user could log the timing of critical
   points in the app by calling (e.g.):

       $self->call_hook('devpopup_timings', 'Before database call');
       do_some_expensive_db_stuff();
       $self->call_hook('devpopup_timings', 'After database call');


Great work!


Michael




It's Particularly seeing which parts of the app



On Wed, 21 Sep 2005 15:17:16 +0200
Rhesa Rozendaal <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I have a working version of a new DevPopup plugin, which should be
> available on CPAN in a couple of hours. The README follows below.
>
> Let me know what you think! Styling tips are most welcome.
>
> Rhesa Rozendaal
>
>
>
> NAME
>     CGI::Application::Plugin::DevPopup - Runtime cgiapp info in a popup
>     window
>
> VERSION
>     Version 0.01
>
> SYNOPSIS
>     End user information
>
>     This module provides a plugin framework for displaying runtime
>     information about your CGI::Application app in a popup window. A
>     sample Timing plugin is provided to show how it works:
>
>        use CGI::Application::Plugin::DevPopup;
>        use CGI::Application::Plugin::DevPopup::Timing;
>
>        The rest of your application follows
>        ...
>
>     Now whenever you access a runmode, a window pops up over your
>     content, showing information about how long the various stages have
>     taken. Adding other CAP::DevPopup plugins will get you more
>     information.
>     A HTML::Tidy plugin showing you how your document conforms to W3C
>     standards is in the works.
>
>     Developer information
>
>     Creating a new plugin for DevPopup is fairly simple. CAP::DevPopup
>     registers a new callback point (named "devpopup_report"),  which it
>     uses to collect output from your plugin. You can add a callback to
>     that point, and return your formatted output from there. The callback
>     has this signature:
>
>        sub callback($cgiapp_class, $outputref)
>
>     You pass your output to the devpopup object by calling
>
>        $cgiapp_class->devpopup->add_report(
>                         title   => $title,
>                         summary => $summary,
>                         report  => $body
>           );
>
>     You are receiving $outputref, because DevPopup wants to be the last
>     one to be called in the postrun callback. If you had wanted to act at
>     postrun time, then please do so with this variable, and not through a
>     callback at postrun.
>
> EXPORTS
>     * devpopup
>        This method is the only one exported into your module, and can be
>        used to access the underlying DevPopup object. See below for
>        methods that this object exposes.
>
> METHODS
>     * add_report( %fields )
>        Adds a new report about the current run of the application. The
>        following fields are supported:
>
>           * title
>              A short title for your report
>
>           * summary
>              An optional one- or two-line summary of your findings
>
>           * report
>              Your full output
>
> AUTHOR
>     Rhesa Rozendaal, "[EMAIL PROTECTED]"
>
> BUGS
>     Please report any bugs or feature requests to
>     "[EMAIL PROTECTED]", or through the web
>     interface at
> <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-DevPopup>.
>
>     I will be notified, and then you'll automatically be notified of
>     progress on your bug as I make changes.
>
> ACKNOWLEDGEMENTS
>     Mark Stosberg for the initial idea, and for pushing me to write it.
>     Sam Tregar for providing me with the skeleton cgiapp_postrun.
>
> COPYRIGHT & LICENSE
>     Copyright 2005 Rhesa Rozendaal, all rights reserved.
>
>     This program is free software; you can redistribute it and/or modify
>     it under the same terms as Perl itself.
>
>
> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/[email protected]/
>               http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---
Michael Graham <[EMAIL PROTECTED]>



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to