You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
packageFoo::Bar;
use Log::Log4perl qw(:easy);
subA {}
subB {}
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;
subA {
DEBUG "entering A, arguments are : " . join('', @_);
new_A(@_);
DEBUG "leaving A";
}
Mike, I wanted to get your thoughts before contributing any code changes.
The text was updated successfully, but these errors were encountered:
8: for my $i (1..3) {
9: foo($i);
in .=main::foo(1) from ./t:9
13: print "$_[0]\n";
1
9: foo($i);
in .=main::foo(2) from ./t:9
13: print "$_[0]\n";
2
9: foo($i);
in .=main::foo(3) from ./t:9
13: print "$_[0]\n";
3
but unfortunately, that doesn't provide the convenience Log4perl users take for granted :). As for Log4perl, many, many years ago (11 to be precise), someone on CPAN set out to create a Log4perl extension to accomplish something similar:
Another bit of existing art that leverages the Perl debugger is https://metacpan.org/pod/Devel::TraceRun. You might request a takeover of the AutoCategorize module, and then get it back to working.
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:
This would look through the symbol table for
Foo::Bar
and replace each subroutine something like this:Mike, I wanted to get your thoughts before contributing any code changes.
The text was updated successfully, but these errors were encountered: