1 package MooseX::Runnable::Invocation::Plugin::Debug;
4 # this is an example to cargo-cult, rather than a useful feature :)
5 has 'debug_prefix' => (
12 sub _build_initargs_from_cmdline {
13 my ($class, @args) = @_;
14 confess 'Bad args passed to Debug plugin'
15 unless @args % 2 == 0;
19 if(my $p = $args{'--prefix'}){
20 return { debug_prefix => $p };
26 my ($self, @msg) = @_;
27 print {*STDERR} $self->debug_prefix, "[$$] ", @msg, "\n";
31 load_class apply_scheme validate_class
32 create_instance start_application
36 before $method => sub {
37 my ($self, @args) = @_;
38 my $args = join ', ', @args;
39 $self->_debug_message("Calling $method($args)");
42 after $method => sub {
44 $self->_debug_message("Returning from $method");