Skip to content

Would Like Auto-Instrumentation of Subroutines #47

Open
@dwmarshall

Description

@dwmarshall

Particularly when I am debugging a module that I haven't maintained before, I'd like to automatically instrument all the subroutines. Here's what I'd like to do:

package Foo::Bar;

use Log::Log4perl qw(:easy);

sub A {}

sub B {}

Log::Log4perl::auto_instrument();
1;

This would look through the symbol table for Foo::Bar and replace each subroutine something like this:

*new_A = \&A;
sub A {
   DEBUG "entering A, arguments are : " . join(' ', @_);
  new_A(@_);
  DEBUG "leaving A";
}

Mike, I wanted to get your thoughts before contributing any code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions