package Catalyst::Log;
+use Class::C3;
use Moose;
use Data::Dump;
our %LEVELS = ();
has level => (is => 'rw');
-has _body => (is => 'rw');
+has _body => (is => 'rw');
has abort => (is => 'rw');
{
}
}
-around new => sub {
- my $orig = shift;
+sub new {
my $class = shift;
- my $self = $class->$orig;
+ my $self = $class->next::method;
$self->levels( scalar(@_) ? @_ : keys %LEVELS );
return $self;
-};
+}
sub levels {
my ( $self, @levels ) = @_;
print STDERR @_;
}
+no Moose;
+__PACKAGE__->meta->make_immutable();
+
1;
__END__
=head2 abort
-Should Catalyst emit logs for this request? Will be reset at the end of
-each request.
+Should Catalyst emit logs for this request? Will be reset at the end of
+each request.
*NOTE* This method is not compatible with other log apis, so if you plan
to use Log4Perl or another logger, you should call it like this: