Skip to content

Commit

Permalink
Add a DEBUG feature to get more info
Browse files Browse the repository at this point in the history
triggered by env var. Can use constant later to fold out.
  • Loading branch information
ingydotnet committed Dec 5, 2014
1 parent 4a66c20 commit 0eb056c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Inline/Module.pm
Expand Up @@ -16,6 +16,13 @@ sub new {
return bless {@_}, $class;
}

sub DEBUG {
return unless $ENV{PERL_INLINE_MODULE_DEBUG};
print ">>>>>> ";
printf @_;
print "\n";
}

#------------------------------------------------------------------------------
# This import serves multiple roles:
# - -MInline::Module=autostub
Expand All @@ -25,6 +32,7 @@ sub new {
#------------------------------------------------------------------------------
sub import {
my $class = shift;
DEBUG "Inline::Module::import(@_)";

my ($inline_module, $program) = caller;

Expand Down Expand Up @@ -89,6 +97,7 @@ sub importer {
name => $inline_module,
);
my $class = shift;
DEBUG "Inline::Module proxy to Inline::%s", @_;
Inline->import_heavy(@_);
};
}
Expand Down

0 comments on commit 0eb056c

Please sign in to comment.