60db3417ceed8a6a0ae61a86ac5f32213fa68a92
[gitmo/MooseX-Runnable.git] / lib / MooseX / Runnable / Invocation / Plugin / Debug.pm
1 package MooseX::Runnable::Invocation::Plugin::Debug;
2 use Moose::Role;
3 use Context::Preserve qw(preserve_context);
4
5 for my $method (qw/load_class apply_scheme validate_class create_instance start_application/){
6
7     requires $method;
8
9     before $method => sub {
10         my ($self, @args);
11         my $args = join ', ', @args;
12         print "Calling $method($args)\n";
13     };
14
15     after $method => sub {
16         my ($next, $self, @args) = @_;
17         print "Returning from $method\n";
18     };
19 }
20
21 1;