X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FLog.pm;h=3f67952b36726bb8b34b5578948b3df5377e37e3;hp=01ff75f603a46e27b63443e34a01fa64067e3876;hb=0fc2d522eec43202c21e9f0062e43f10db4d9008;hpb=3cdcf968aa321182c36f5fe4f499d581f59bdeac diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index 01ff75f..3f67952 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -1,21 +1,15 @@ package Catalyst::Log; -use strict; -#use base 'Class::Accessor::Fast'; +use Class::C3; +use Moose; use Data::Dump; our %LEVELS = (); -use Moose; - has level => (is => 'rw'); -has _body => (is => 'rw'); +has _body => (is => 'rw'); has abort => (is => 'rw'); -#__PACKAGE__->mk_accessors('level'); -#__PACKAGE__->mk_accessors('body'); -#__PACKAGE__->mk_accessors('abort'); - { my @levels = qw[ debug info warn error fatal ]; @@ -45,7 +39,7 @@ has abort => (is => 'rw'); sub new { my $class = shift; - my $self = $class->SUPER::new; + my $self = $class->next::method; $self->levels( scalar(@_) ? @_ : keys %LEVELS ); return $self; } @@ -105,6 +99,9 @@ sub _send_to_log { print STDERR @_; } +no Moose; +__PACKAGE__->meta->make_immutable(); + 1; __END__ @@ -256,4 +253,6 @@ it under the same terms as Perl itself. =cut +__PACKAGE__->meta->make_immutable; + 1;