logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

CGI::Application::Plugin::DevPopup::Log - show all data written to an IO::Scalar handle.

Author

       Joshua I Miller, unrtst@cpan.org

Bugs

       Please report any bugs or feature requests to bug-cgi-application-plugin-devpopup@rt.cpan.org, 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.

Description

       CGI::Application::Plugin::DevPopup::Log will create a "Log" section in the DevPopup output. All data
       written to the filehandle returned by "$this->devpopup_log_handle" will be output.

       CGI::Application::Plugin::LogDispatch is very handy for this, but you can write to that filehandle anyway
       you'd like.

Methods

       devpopup_log_handle
           Generates a (fake) filehandle you can pass on to a logging plugin. See the Synopsis for usage.

Name

       CGI::Application::Plugin::DevPopup::Log - show all data written to an IO::Scalar handle.

See Also

           L<CGI::Application::Plugin::DevPopup>
           L<CGI::Application>
           L<CGI::Application::Plugin::LogDispatch>

Synopsis

           use CGI::Application::Plugin::DevPopup;
           use CGI::Application::Plugin::DevPopup::Log;

           sub cgiapp_init {
               # example using LogDispatch
               my $log_fh = $this->devpopup_log_handle;
               $this->log_config(
                   APPEND_NEWLINE => 1,
                   LOG_DISPATCH_MODULES => [
                           {   module      => 'Log::Dispatch::Handle',
                               name        => 'popup',
                               min_level   => $ENV{CAP_DEVPOPUP_LOGDISPATCH_LEVEL} || 'debug',
                               handle      => $log_fh,
                           },
                       ]
                   );
               $this->log->debug("log something");
           }
           The rest of your application follows
           ...

Version

       version 1.08

See Also