Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-LogDispatch CPAN distribution.

Report information
The Basics
Id: 46967
Status: open
Priority: 0/
Queue: CGI-Application-Plugin-LogDispatch

People
Owner: Nobody in particular
Requestors: jaldhar [...] braincells.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.02
Fixed in: (no value)



Subject: wrong test for devpopup support
This plugin includes CAP::DevPopup support like this: if (UNIVERSAL::can($self, 'devpopup')) { # Register our report with DevPopup $self->add_callback( 'devpopup_report', \&_devpopup_report ); # Create logger to capture all log entries However it is possible to have the DevPopup plugin loaded but not enabled (If you are using Titanium for instance.) In this case you will get an error like this: Can't locate object method "new" via package "Log::Dispatch::File" (perhaps you forgot to load "Log::Dispatch::File"?) at /usr/share/perl5/CGI/Application/Plugin/LogDispatch.pm line 97. unless you have Log::Dispatch::File loaded which you might not. I suggest 1. The test be changed to if ( defined $ENV{CAP_DEVPOPUP_EXEC} ) so support is only added if DevPopup is enabled. 2. Log::Dispatch::File is require'd before the logger is attempted to be created. I have enclosed a patch that does this.
Subject: patch.txt
--- LogDispatch.pm.orig 2009-06-15 15:37:18.000000000 -0400 +++ LogDispatch.pm 2009-06-15 15:39:20.000000000 -0400 @@ -80,10 +80,12 @@ _set_object($frompkg||$self, $log); # CAP::DevPopup support - if (UNIVERSAL::can($self, 'devpopup')) { + if (defined $ENV{'CAP_DEVPOPUP_EXEC'}) { # Register our report with DevPopup $self->add_callback( 'devpopup_report', \&_devpopup_report ); + require Log::Dispatch::File; + # Create logger to capture all log entries my %options = ( 'name' => 'DevPopup',
From: amelia.ireland [...] gmail.com
On Mon Jun 15 15:41:32 2009, JALDHAR wrote: [snip] Show quoted text
> However it is possible to have the DevPopup plugin loaded but not > enabled (If you are using Titanium for instance.) In this case you > will get an error like this: > > Can't locate object method "new" via package "Log::Dispatch::File" > (perhaps you forgot to load "Log::Dispatch::File"?) at > /usr/share/perl5/CGI/Application/Plugin/LogDispatch.pm line 97. > > unless you have Log::Dispatch::File loaded which you might not.
[snip] Please could you at least add 'use Log::Dispatch::File' to the top of the module so that Titanium users don't get the error mentioned above?