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