Subject: | Upgrades needed to be compatible with Catalyst 5.8 |
Hi,
I've upgraded Catalyst to 5.8002 and noticed some warning messages
causes by C::P::Log::Dispatch.
1)
As explained in
http://search.cpan.org/~flora/Catalyst-Runtime-5.80002/lib/Catalyst/Upgrading.pod#Catalyst::Base,
could you make a new release available to get rid of the warning when
starting application :
'MyApp is using the deprecated Catalyst::Base, update your application
as this will be removed in the next major release at
/usr/local/share/perl/5.8.8/Catalyst/Base.pm line 7'
I made a small hack to your plugin :
--- Dispatch.pm 2009-04-23 13:54:44.000000000 +0200
+++ Dispatch.pm.ori 2009-04-23 13:54:27.000000000 +0200
@@ -5,7 +5,7 @@
our $VERSION = '0.09';
-use base 'Catalyst::Controller';
+use base 'Catalyst::Base';
use UNIVERSAL::require;
And the message has disappeared.
2)
Second is about a backward compatibility between 5.7 and 5.8 :
'Class Catalyst::Log is calling the deprecated method
Catalyst::Log->body method,
this will be removed in Catalyst 5.81 at
/usr/local/share/perl/5.8.8/Catalyst/Log.pm line 113.
'
Here is the patch I applied tomy C::P::Log::Dispatch to get rid of the
warning message
@@ -63,9 +63,9 @@
$class->use or die "$@";
$c->log->add( $class->new(%logc) );
}
- if ($old_log && defined $old_log->_body) {
+ if ($old_log && defined $old_log->body) {
my @old_logs;
- foreach my $line ( split /\n/, $old_log->_body ) {
+ foreach my $line ( split /\n/, $old_log->body ) {
if ( $line =~ /^\[(\w+)] (.+)$/ ) {
push( @old_logs, { level => $1, msg => [$2] } );
}
Hope this will be helpful.
Regards
Emmanuel