Skip Menu |

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 47933
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Debugging flag, like make has
It would be nice if Module::Build had a debug flag similar to "make -d" which outputs information about what dependencies are being resolved, which are up to date, and what actions are being called. This would help users figure out what it is Module::Build is doing.
This simple patch does that if --verbose is given, at least for ACTION_*. Is that sufficient? Or too annoying when running tests with verbose? If so, do we just add a "--debug" property and document it? If we do, we should probably create a log_debug method like log_verbose and then we can sprinkle it anywhere else we want to add debugging diagnostics. Thoughts? Index: lib/Module/Build/Base.pm =================================================================== --- lib/Module/Build/Base.pm (revision 13014) +++ lib/Module/Build/Base.pm (working copy) @@ -1593,7 +1593,10 @@ local $self->{action} = $action; my $method = $self->can_action( $action ); die "No action '$action' defined, try running the 'help' action.\n" unless $method; - return $self->$method(); + $self->log_verbose("Starting ACTION_$action\n"); + my $rc = $self->$method(); + $self->log_verbose("Finished ACTION_$action\n"); + return $rc; } sub can_action {
Subject: Re: [rt.cpan.org #47933] Debugging flag, like make has
Date: Thu, 16 Jul 2009 02:11:49 -0700
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
David Golden via RT wrote: Show quoted text
> This simple patch does that if --verbose is given, at least for > ACTION_*. Is that sufficient? Or too annoying when running tests with > verbose? If so, do we just add a "--debug" property and document it? > If we do, we should probably create a log_debug method like log_verbose > and then we can sprinkle it anywhere else we want to add debugging > diagnostics.
I think its cutting too fine a hair to separate them. At that point you can grep and the like. This is a good start, thanks! Show quoted text
> Index: lib/Module/Build/Base.pm > =================================================================== > --- lib/Module/Build/Base.pm (revision 13014) > +++ lib/Module/Build/Base.pm (working copy) > @@ -1593,7 +1593,10 @@ > local $self->{action} = $action; > my $method = $self->can_action( $action ); > die "No action '$action' defined, try running the 'help' action.\n" > unless $method; > - return $self->$method(); > + $self->log_verbose("Starting ACTION_$action\n"); > + my $rc = $self->$method(); > + $self->log_verbose("Finished ACTION_$action\n"); > + return $rc; > } > > sub can_action { > > >
-- Stabbing you in the face so you don't have to.
Having slept on it (a few hours at least), I'm more inclined towards the --debug option. I know I use verbose a lot in my own module dev testing and to the extent we add more and more diagnostic debug output, I wouldn't want it to clutter things up for an ordinary "verbose" Build or Build test run.
Added --debug flag and simple test to the repository.