X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FLog.pm;h=3f67952b36726bb8b34b5578948b3df5377e37e3;hb=f3414019f472b55682ef3af53f761b6db7955887;hp=1314ceb5f9c413a51ec3033695525625c27f1af7;hpb=ac5c933bdd463558e8d621507a53a7b247a9093e;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index 1314ceb..3f67952 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -1,12 +1,13 @@ 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'); { @@ -36,13 +37,12 @@ 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 ) = @_; @@ -99,6 +99,9 @@ sub _send_to_log { print STDERR @_; } +no Moose; +__PACKAGE__->meta->make_immutable(); + 1; __END__