Subject: | New release required for Catalyst 5.8 |
Since Catalyst moved to Moose at 5.8 some things have been deprecated, e.g. use NEXT;
I attach the patches for CPLH that switch from NEXT to MRO::Compat and
update the call to the Log::Handler constructor, it now has a different
format
I attach the patches for CPLH that switch from NEXT to MRO::Compat and
update the call to the Log::Handler constructor, it now has a different
format
Subject: | work.diff |
--- t/work.t 2009-11-26 18:19:30.000000000 +0000
+++ t/work.t 2009-11-26 18:53:40.000000000 +0000
@@ -18,46 +18,33 @@
{
package Catalyst::Plugin::Log::Handler::Test;
- use base qw(Class::Accessor::Fast Catalyst::Plugin::Log::Handler);
+ use base qw( Catalyst::Plugin::Log::Handler Class::Accessor::Fast);
__PACKAGE__->mk_accessors(qw(log config));
-}
-
-my $c = Catalyst::Plugin::Log::Handler::Test->new({
- config => {
- 'Log::Handler' => {
- filename => \*STDOUT,
- mode => 'append',
- newline => 1,
- },
- },
- });
-
-$c->setup();
+}
-my $pipe;
+my $c = Catalyst::Plugin::Log::Handler::Test->new();
-my $pid = open $pipe, '-|';
-defined $pid or die $!;
+$c->config( {
+ 'Log::Handler' => {
+ filename => 't/log-handler-test',
+ mode => 'append',
+ newline => 1,
+ },
+});
-unless ($pid) {
- require Catalyst::Plugin::Log::Handler;
+$c->setup();
- for my $level (LEVELS) {
- $c->log->$level("This is a $level test message.");
- }
- $c->log->handler->crit('This is a crit test message.');
-
- exit(0);
+for my $level (LEVELS) {
+ $c->log->$level("This is a $level test message.");
}
-my $logtext = do {local $/; <$pipe>};
-defined $logtext or die $!;
+$c->log->handler->crit('This is a crit test message.');
-print "This was logged: (\n$logtext)\n";
+my $logtext = do {local $/; open FH, '<t/log-handler-test'; <FH> };
-close $pipe or die "Child exit status: $?\n";
+defined $logtext or die $!;
my $numberlevels = () = LEVELS;
Subject: | Log::Handler.diff |
--- Catalyst/Plugin/Log/Handler.pm 2009-11-26 18:08:37.000000000 +0000
+++ Catalyst/Plugin/Log/Handler.pm 2009-11-26 18:14:08.000000000 +0000
@@ -8,13 +8,13 @@
=head1 VERSION
-Version 0.07
+Version 0.08
=cut
-our $VERSION = '0.07';
+our $VERSION = '0.08';
-use NEXT;
+use MRO::Compat;
sub setup {
my $c = shift;
@@ -23,7 +23,7 @@
$c->log((__PACKAGE__ . '::Backend')->new($config));
- return $c->NEXT::setup(@_);
+ return $c->next::method(@_);
}
@@ -31,7 +31,8 @@
use strict;
use warnings;
use base qw(Class::Accessor::Fast);
-use Log::Handler 0.33;
+use Log::Handler 0.63;
+use MRO::Compat;
__PACKAGE__->mk_accessors(qw(handler));
@@ -68,7 +69,7 @@
sub new {
my $class = shift;
- my $self = $class->SUPER::new;
+ my $self = $class->next::method();
my ($config) = @_;
@@ -80,11 +81,11 @@
# Log::Handler->new will fail if there's no filename in the conf. But let's
# try it anyway to convince the user.
- $self->handler(Log::Handler->new(
+ $self->handler(Log::Handler->new( file => {
minlevel => 0,
maxlevel => 7,
%$config,
- ));
+ } ));
return $self;
}
@@ -100,10 +101,11 @@
Catalyst configuration (e. g. in YAML format):
Log::Handler:
- filename: /var/log/myapp.log
- fileopen: 1
- mode: append
- newline: 1
+ file:
+ filename: /var/log/myapp.log
+ fileopen: 1
+ mode: append
+ newline: 1
To log a message: