start using Class::C3, may need to add a reinitalize bit later, not sure
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Log.pm
index 01ff75f..3f67952 100644 (file)
@@ -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;