Hello community, here is the log from the commit of package perl-Debug-Trace for openSUSE:Factory checked in at 2013-11-26 19:25:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Debug-Trace (Old) and /work/SRC/openSUSE:Factory/.perl-Debug-Trace.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Debug-Trace" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Debug-Trace/perl-Debug-Trace.changes 2011-09-23 12:36:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Debug-Trace.new/perl-Debug-Trace.changes 2013-11-26 19:25:16.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Nov 25 07:36:44 UTC 2013 - [email protected] + +- updated to 0.05 + - Update tests for Carp >= 1.32 +- new cpanspec template + +------------------------------------------------------------------- Old: ---- Debug-Trace-0.04.tar.gz New: ---- Debug-Trace-0.05.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Debug-Trace.spec ++++++ --- /var/tmp/diff_new_pack.sLsEd2/_old 2013-11-26 19:25:17.000000000 +0100 +++ /var/tmp/diff_new_pack.sLsEd2/_new 2013-11-26 19:25:17.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Debug-Trace # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,35 +15,40 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - Name: perl-Debug-Trace +Version: 0.05 +Release: 0 %define cpan_name Debug-Trace Summary: Perl extension to trace subroutine calls -Version: 0.04 -Release: 1 License: GPL-1.0+ or Artistic-1.0 Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Debug-Trace/ -Source: http://www.cpan.org/authors/id/J/JV/JV/Debug-Trace-%{version}.tar.gz +Source: http://www.cpan.org/authors/id/J/JV/JV/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{perl_requires} BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Data::Dumper) >= 2.101 -Requires: perl(Data::Dumper) >= 2.101 +#BuildRequires: perl(Debug::Trace) +%{perl_requires} %description Debug::Trace instruments subroutines to provide tracing information upon every call and return. -Authors: --------- - Jan-Pieter Cornet <[email protected]> - Jos Boumans <[email protected]> - Johan Vromans <[email protected]> +Using Debug::Trace does not require any changes to your sources. Most +often, it will be used from the command line: + + perl -MDebug::Trace=foo,bar yourprogram.pl + +This will have your subroutines foo() and bar() printing call and return +information. + +Subroutine names may be fully qualified to denote subroutines in other +packages than the default main::. + +By default, the trace information is output using the standard warn() +function. %prep %setup -q -n %{cpan_name}-%{version} @@ -57,18 +62,11 @@ %install %perl_make_install -# do not perl_process_packlist (noarch) -# remove .packlist file -%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch -# remove perllocal.pod file -%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib +%perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf $RPM_BUILD_ROOT - %files -f %{name}.files -%defattr(-,root,root,-) +%defattr(-,root,root,755) %doc Changes README %changelog ++++++ Debug-Trace-0.04.tar.gz -> Debug-Trace-0.05.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/Changes new/Debug-Trace-0.05/Changes --- old/Debug-Trace-0.04/Changes 2002-10-05 11:02:16.000000000 +0200 +++ new/Debug-Trace-0.05/Changes 2013-11-07 14:06:02.000000000 +0100 @@ -19,3 +19,6 @@ 0.04 Fri Oct 4 22:01:45 2002 - Add tests, update documentation and small fixes for caller, stacktrace, maxlen. + +0.05 Thu Nov 7 2002 + - Update tests for Carp >= 1.32. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/MANIFEST new/Debug-Trace-0.05/MANIFEST --- old/Debug-Trace-0.04/MANIFEST 2002-10-05 11:02:16.000000000 +0200 +++ new/Debug-Trace-0.05/MANIFEST 2013-11-07 14:07:20.000000000 +0100 @@ -2,8 +2,10 @@ Makefile.PL MANIFEST README -Trace.pm +lib/Debug/Trace.pm t/basic.t t/caller.t t/maxlen.t t/stack.t +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/META.json new/Debug-Trace-0.05/META.json --- old/Debug-Trace-0.04/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/Debug-Trace-0.05/META.json 2013-11-07 14:07:20.000000000 +0100 @@ -0,0 +1,41 @@ +{ + "abstract" : "Perl extension to trace subroutine calls", + "author" : [ + "JPC, KANE, JV" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921", + "license" : [ + "unknown" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Debug-Trace", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Data::Dumper" : "2.101" + } + } + }, + "release_status" : "stable", + "version" : "0.05" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/META.yml new/Debug-Trace-0.05/META.yml --- old/Debug-Trace-0.04/META.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/Debug-Trace-0.05/META.yml 2013-11-07 14:07:20.000000000 +0100 @@ -0,0 +1,22 @@ +--- +abstract: 'Perl extension to trace subroutine calls' +author: + - 'JPC, KANE, JV' +build_requires: + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921' +license: unknown +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Debug-Trace +no_index: + directory: + - t + - inc +requires: + Data::Dumper: 2.101 +version: 0.05 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/Makefile.PL new/Debug-Trace-0.05/Makefile.PL --- old/Debug-Trace-0.04/Makefile.PL 2002-10-16 12:29:15.000000000 +0200 +++ new/Debug-Trace-0.05/Makefile.PL 2013-11-07 13:53:41.000000000 +0100 @@ -4,14 +4,14 @@ my %ctl = ( NAME => 'Debug::Trace', - VERSION_FROM => 'Trace.pm', + VERSION_FROM => 'lib/Debug/Trace.pm', PREREQ_PM => { 'Data::Dumper' => 2.101, }, ); if ( $] >= 5.005 ) { - $ctl{ABSTRACT_FROM} = 'Trace.pm'; + $ctl{ABSTRACT_FROM} = 'lib/Debug/Trace.pm'; $ctl{AUTHOR} = 'JPC, KANE, JV'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/README new/Debug-Trace-0.05/README --- old/Debug-Trace-0.04/README 2002-10-16 12:30:19.000000000 +0200 +++ new/Debug-Trace-0.05/README 2013-11-07 13:56:56.000000000 +0100 @@ -41,7 +41,7 @@ COPYRIGHT AND LICENCE -Copyright 2002 Amsterdam.pm -- All Rights Reserved. +Copyright 2002,2013 Amsterdam.pm -- All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/Trace.pm new/Debug-Trace-0.05/Trace.pm --- old/Debug-Trace-0.04/Trace.pm 2002-10-16 12:36:42.000000000 +0200 +++ new/Debug-Trace-0.05/Trace.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,355 +0,0 @@ -package Debug::Trace; - -use 5.00503; # Yes! -$VERSION = '0.04'; - -use strict; -#use warnings; # Such a pity we cannot use this one... - -use Data::Dumper; -use Carp; - -my @debug; - -sub import { - shift; - push @debug, [ scalar caller, @_ ]; -} - -# Fully qualify package names. -sub _q { - my($name, $pkg) = @_; - - $name =~ /::/ ? $name : $pkg . "::" . $name; -} - -# Nicely formatted argument values closure. -sub _mkv { - my $config = shift; - - return sub { - local $Data::Dumper::Indent = $config->{ indent }; - local $Data::Dumper::Useqq = $config->{ useqq }; - local $Data::Dumper::Maxdepth = $config->{ maxdepth }; - local $Data::Dumper::Quotekeys = $config->{ quotekeys }; - local $Data::Dumper::Sortkeys = $config->{ sortkeys }; - my $args = Data::Dumper->Dump([shift]); - $args = $1 if $args =~ /\[(.*)\];/s; - $args; - }; -} - -# create appropriate output closure -sub _mkout { - my $config = shift; - - my $trunc; - if ( my $maxlen = $config->{maxlen} ) { - $trunc = sub { - if ( length($_[0]) > $maxlen ) { - return substr($_[0], 0, $maxlen - 3) . "...\n"; - } - else { - return $_[0]; - } - }; - } - - if ( $config->{'warn'} ) { - return sub { - warn $trunc ? $trunc->(join("", @_)) : @_; - }; - } - else { - return sub { - print STDERR $trunc ? $trunc->(join("", @_)) : @_; - }; - } -} - -# create appropriate "TRACE: called..." closure -sub _mkpre { - my($config, $out) = @_; - - my $st = $config->{ stacktrace }; - if ( $config->{'caller'} ) { - return sub { - my($pkg, $file, $line) = caller(1); - my(undef, undef, undef, $sub) = caller(2); - if ( $st ) { - local $Carp::CarpLevel = 1; - my $msg = Carp::longmess; - $msg =~ s/^ at .*\n//; - $msg =~ s/ called at .*?Trace\.pm line \d+\n\tDebug::Trace::__ANON__//g; - $out->("TRACE:\t", @_, " called at ", - "$file line $line\n", $msg); - } - else { - $out->("TRACE:\t", @_, " called at ", - "$file line $line ", - (defined $sub ? "sub $sub" : "package $pkg"), - "\n"); - } - }; - } - else { - return sub { - $out->("TRACE:\t", @_, "\n"); - }; - } -} - -# Generate the closure to handle the tracing. -sub _s { - my ($fqs, $cref, $config) = @_; - - my $out = _mkout($config); - my $pre = _mkpre($config, $out); - my $v = _mkv($config); - - sub { - $pre->("$fqs(", $v->(\@_), ")"); - if ( !defined wantarray ) { - &$cref; - $out->("TRACE:\t$fqs() returned\n"); - } - elsif ( wantarray ) { - my @r = &$cref; - $out->("TRACE:\t$fqs() returned: (", $v->(\@r), ")\n"); - @r; - } - else { - my $r = &$cref; - $out->("TRACE:\t$fqs() returned: ", $v->([$r]), "\n"); - $r; - } - }; -} - -# Better use CHECK, but this requires Perl 5.6 or later. -sub INIT { - - # configurable options - my %config; - - _default_config(\%config); - - for my $d ( @debug ) { - my($caller, @subs) = @$d; - - for my $s ( @subs ) { - - # is it a config option? - if ( $s =~ /^:\w/ ) { - _config_option(\%config, $s); - next; - } - - my $fqs = _q($s, $caller); - no strict 'refs'; - my $cref = *{ $fqs }{CODE}; - if ( !$cref ) { - warn "Instrumenting unknown function $fqs\n" if $^W; - next; - } - # no warnings 'redefine'; - local($^W) = 0; - *{ $fqs } = _s($fqs, $cref, \%config); - } - } -} - -# fill default config options -sub _default_config { - my $config = shift; - - $config->{ 'warn' } = 1; - $config->{ 'caller' } = 1; - $config->{ stacktrace } = 0; - $config->{ maxlen } = 0; - - # Data::Dumper specific options - $config->{ indent } = 0; - $config->{ useqq } = 1; - $config->{ maxdepth } = 2; - $config->{ quotekeys } = 0; - $config->{ sortkeys } = 0; - - if ( my $e = $ENV{PERL5DEBUGTRACE} ) { - for my $c ( split /[\s:]+(?!\()/, $e ) { - next unless $c; - _config_option($config, ":".$c); - } - } -} - -# process one config option -sub _config_option { - my $config = shift; - $_ = lc(shift); - - if ( /^:no(\w+)$/ && exists $config->{$1} ) { - $config->{$1} = 0; - } - elsif ( /^:(\w+)$/ && exists $config->{$1} ) { - $config->{$1} = 1; - } - elsif ( /^:(\w+)\s*\((-?\d+)\)$/ && exists $config->{$1} ) { - $config->{$1} = $2; - } - else { - warn "Unrecognized Debug::Trace config option $_\n"; - } -} - -1; - -=head1 NAME - -Debug::Trace - Perl extension to trace subroutine calls - -=head1 SYNOPSIS - - perl -MDebug::Trace=foo,bar yourprogram.pl - -=head1 DESCRIPTION - -Debug::Trace instruments subroutines to provide tracing information -upon every call and return. - -Using Debug::Trace does not require any changes to your sources. Most -often, it will be used from the command line: - - perl -MDebug::Trace=foo,bar yourprogram.pl - -This will have your subroutines foo() and bar() printing call and -return information. - -Subroutine names may be fully qualified to denote subroutines in other -packages than the default main::. - -By default, the trace information is output using the standard warn() -function. - -=head2 MODIFIERS - -Modifiers can be inserted in the list of subroutines to change the -default behavior of this module. All modifiers can be used in three -ways: - -=over 4 - -=item * - -C<:>I<name> to enable a specific feature. - -=item * - -C<:no>I<name> to disable a specific feature. - -=item * - -C<:>I<name>C<(>I<value>C<)> to set a feature to a specific value. In -general, C<:>I<name> is equivalent to C<:>I<name>C<(1)>, while -C<:no>I<name> corresponds to C<:>I<name>C<(0)>. - -=back - -The following modifiers are recognized: - -=over 4 - -=item :warn - -Uses warn() to produce the trace output (default). C<:nowarn> Sends -trace output directly to STDERR. - -=item :caller - -Add basic call information to the trace message, including from where -the routine was called, and by whom. This is enabled by default. - -=item :stacktrace - -Add a stack trace (call history). - -=item :maxlen(I<length>) - -Truncate the length of the lines of trace information to I<length> -characters. - -=back - -The following modifiers can be used to control the way Data::Dumper -prints the values of parameters and return values. See also L<Data::Dumper>. - -=over 4 - -=item :indent - -Controls the style of indentation. It can be set to 0, 1, 2 or 3. -Style 0 spews output without any newlines, indentation, or spaces -between list items. C<:indent(0)> is the default. - -=item :useqq - -When enabled, uses double quotes for representing string values. -Whitespace other than space will be represented as C<[\n\t\r]>, -"unsafe" characters will be backslashed, and unprintable characters -will be output as quoted octal integers. This is the default, -use C<:nouseqq> to disable. - -=item :maxdepth(I<depth>) - -Can be set to a positive integer that specifies the depth beyond which -which we don't print structure contents. The default is 2, which means -one level of array/hashes in argument lists and return values is expanded. -If you use C<:nomaxdepth> or C<:maxdepth(0)>, nested structures are -fully expanded. - -=item :quotekeys - -Controls wether hash keys are always printed quoted. The default is -C<:noquotekeys>. - -=item sortkeys - -Controls whether hash keys are dumped in sorted order. The default is -C<:nosortkeys>. - -=back - -Modifiers apply only to the subroutines that follow in the list of -arguments. - -=head1 METHODS - -None, actually. Everything is handled by the module's import. - -=head1 ENVIRONMENT VARIABLES - -Environment variable C<PERL5DEBUGTRACE> can be used to preset initial -modifiers, e.g.: - - export PERL5DEBUGTRACE=":warn:indent(2):nomaxdepth:quotekeys" - -=head1 SEE ALSO - -L<Data::Dumper>, L<Carp> - -=head1 AUTHOR - -Jan-Pieter Cornet <[email protected]>; -Jos Boumans <[email protected]>; -Johan Vromans <[email protected]>; - -This is an Amsterdam.pm production. See http://amsterdam.pm.org. - -=head1 COPYRIGHT - -Copyright 2002 Amsterdam.pm. All rights reserved. - -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/lib/Debug/Trace.pm new/Debug-Trace-0.05/lib/Debug/Trace.pm --- old/Debug-Trace-0.04/lib/Debug/Trace.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Debug-Trace-0.05/lib/Debug/Trace.pm 2013-11-07 14:04:58.000000000 +0100 @@ -0,0 +1,359 @@ +#! perl + +package Debug::Trace; + +use 5.00503; # Yes! +$VERSION = '0.05'; + +use strict; +#use warnings; # Such a pity we cannot use this one... + +use Data::Dumper; +use Carp; + +my @debug; + +sub import { + shift; + push @debug, [ scalar caller, @_ ]; +} + +# Fully qualify package names. +sub _q { + my($name, $pkg) = @_; + + $name =~ /::/ ? $name : $pkg . "::" . $name; +} + +# Nicely formatted argument values closure. +sub _mkv { + my $config = shift; + + return sub { + local $Data::Dumper::Indent = $config->{ indent }; + local $Data::Dumper::Useqq = $config->{ useqq }; + local $Data::Dumper::Maxdepth = $config->{ maxdepth }; + local $Data::Dumper::Quotekeys = $config->{ quotekeys }; + local $Data::Dumper::Sortkeys = $config->{ sortkeys }; + my $args = Data::Dumper->Dump([shift]); + $args = $1 if $args =~ /\[(.*)\];/s; + $args; + }; +} + +# create appropriate output closure +sub _mkout { + my $config = shift; + + my $trunc; + if ( my $maxlen = $config->{maxlen} ) { + $trunc = sub { + if ( length($_[0]) > $maxlen ) { + return substr($_[0], 0, $maxlen - 3) . "...\n"; + } + else { + return $_[0]; + } + }; + } + + if ( $config->{'warn'} ) { + return sub { + warn $trunc ? $trunc->(join("", @_)) : @_; + }; + } + else { + return sub { + print STDERR $trunc ? $trunc->(join("", @_)) : @_; + }; + } +} + +# create appropriate "TRACE: called..." closure +sub _mkpre { + my($config, $out) = @_; + + my $st = $config->{ stacktrace }; + if ( $config->{'caller'} ) { + return sub { + my($pkg, $file, $line) = caller(1); + my(undef, undef, undef, $sub) = caller(2); + if ( $st ) { + local $Carp::CarpLevel = 1; + my $msg = Carp::longmess; + $msg =~ s/^ at .*\n//; + $msg =~ s/ called at .*?Trace\.pm line \d+\n\tDebug::Trace::__ANON__//g; + $out->("TRACE:\t", @_, " called at ", + "$file line $line\n", $msg); + } + else { + $out->("TRACE:\t", @_, " called at ", + "$file line $line ", + (defined $sub ? "sub $sub" : "package $pkg"), + "\n"); + } + }; + } + else { + return sub { + $out->("TRACE:\t", @_, "\n"); + }; + } +} + +# Generate the closure to handle the tracing. +sub _s { + my ($fqs, $cref, $config) = @_; + + my $out = _mkout($config); + my $pre = _mkpre($config, $out); + my $v = _mkv($config); + + sub { + $pre->("$fqs(", $v->(\@_), ")"); + if ( !defined wantarray ) { + &$cref; + $out->("TRACE:\t$fqs() returned\n"); + } + elsif ( wantarray ) { + my @r = &$cref; + $out->("TRACE:\t$fqs() returned: (", $v->(\@r), ")\n"); + @r; + } + else { + my $r = &$cref; + $out->("TRACE:\t$fqs() returned: ", $v->([$r]), "\n"); + $r; + } + }; +} + +# Better use CHECK, but this requires Perl 5.6 or later. +sub INIT { + + # configurable options + my %config; + + _default_config(\%config); + + for my $d ( @debug ) { + my($caller, @subs) = @$d; + + for my $s ( @subs ) { + + # is it a config option? + if ( $s =~ /^:\w/ ) { + _config_option(\%config, $s); + next; + } + + my $fqs = _q($s, $caller); + no strict 'refs'; + my $cref = *{ $fqs }{CODE}; + if ( !$cref ) { + warn "Instrumenting unknown function $fqs\n" if $^W; + next; + } + # no warnings 'redefine'; + local($^W) = 0; + *{ $fqs } = _s($fqs, $cref, \%config); + } + } +} + +# fill default config options +sub _default_config { + my $config = shift; + + $config->{ 'warn' } = 1; + $config->{ 'caller' } = 1; + $config->{ stacktrace } = 0; + $config->{ maxlen } = 0; + + # Data::Dumper specific options + $config->{ indent } = 0; + $config->{ useqq } = 1; + $config->{ maxdepth } = 2; + $config->{ quotekeys } = 0; + $config->{ sortkeys } = 0; + + if ( my $e = $ENV{PERL5DEBUGTRACE} ) { + for my $c ( split /[\s:]+(?!\()/, $e ) { + next unless $c; + _config_option($config, ":".$c); + } + } +} + +# process one config option +sub _config_option { + my $config = shift; + $_ = lc(shift); + + if ( /^:no(\w+)$/ && exists $config->{$1} ) { + $config->{$1} = 0; + } + elsif ( /^:(\w+)$/ && exists $config->{$1} ) { + $config->{$1} = 1; + } + elsif ( /^:(\w+)\s*\((-?\d+)\)$/ && exists $config->{$1} ) { + $config->{$1} = $2; + } + else { + warn "Unrecognized Debug::Trace config option $_\n"; + } +} + +1; + +=head1 NAME + +Debug::Trace - Perl extension to trace subroutine calls + +=head1 SYNOPSIS + + perl -MDebug::Trace=foo,bar yourprogram.pl + +=head1 DESCRIPTION + +Debug::Trace instruments subroutines to provide tracing information +upon every call and return. + +Using Debug::Trace does not require any changes to your sources. Most +often, it will be used from the command line: + + perl -MDebug::Trace=foo,bar yourprogram.pl + +This will have your subroutines foo() and bar() printing call and +return information. + +Subroutine names may be fully qualified to denote subroutines in other +packages than the default main::. + +By default, the trace information is output using the standard warn() +function. + +=head2 MODIFIERS + +Modifiers can be inserted in the list of subroutines to change the +default behavior of this module. All modifiers can be used in three +ways: + +=over 4 + +=item * + +C<:>I<name> to enable a specific feature. + +=item * + +C<:no>I<name> to disable a specific feature. + +=item * + +C<:>I<name>C<(>I<value>C<)> to set a feature to a specific value. In +general, C<:>I<name> is equivalent to C<:>I<name>C<(1)>, while +C<:no>I<name> corresponds to C<:>I<name>C<(0)>. + +=back + +The following modifiers are recognized: + +=over 4 + +=item :warn + +Uses warn() to produce the trace output (default). C<:nowarn> Sends +trace output directly to STDERR. + +=item :caller + +Add basic call information to the trace message, including from where +the routine was called, and by whom. This is enabled by default. + +=item :stacktrace + +Add a stack trace (call history). + +=item :maxlen(I<length>) + +Truncate the length of the lines of trace information to I<length> +characters. + +=back + +The following modifiers can be used to control the way Data::Dumper +prints the values of parameters and return values. See also L<Data::Dumper>. + +=over 4 + +=item :indent + +Controls the style of indentation. It can be set to 0, 1, 2 or 3. +Style 0 spews output without any newlines, indentation, or spaces +between list items. C<:indent(0)> is the default. + +=item :useqq + +When enabled, uses double quotes for representing string values. +Whitespace other than space will be represented as C<[\n\t\r]>, +"unsafe" characters will be backslashed, and unprintable characters +will be output as quoted octal integers. This is the default, +use C<:nouseqq> to disable. + +=item :maxdepth(I<depth>) + +Can be set to a positive integer that specifies the depth beyond which +which we don't print structure contents. The default is 2, which means +one level of array/hashes in argument lists and return values is expanded. +If you use C<:nomaxdepth> or C<:maxdepth(0)>, nested structures are +fully expanded. + +=item :quotekeys + +Controls wether hash keys are always printed quoted. The default is +C<:noquotekeys>. + +=item sortkeys + +Controls whether hash keys are dumped in sorted order. The default is +C<:nosortkeys>. + +=back + +Modifiers apply only to the subroutines that follow in the list of +arguments. + +=head1 METHODS + +None, actually. Everything is handled by the module's import. + +=head1 ENVIRONMENT VARIABLES + +Environment variable C<PERL5DEBUGTRACE> can be used to preset initial +modifiers, e.g.: + + export PERL5DEBUGTRACE=":warn:indent(2):nomaxdepth:quotekeys" + +=head1 SEE ALSO + +L<Data::Dumper>, L<Carp> + +=head1 AUTHOR + +Jan-Pieter Cornet <[email protected]>; +Jos Boumans <[email protected]>; +Johan Vromans <[email protected]>; + +This is an Amsterdam.pm production. See http://amsterdam.pm.org. + +Current maintainer is Johan Vromans <[email protected]>. + +=head1 COPYRIGHT + +Copyright 2002,2013 Amsterdam.pm. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Debug-Trace-0.04/t/stack.t new/Debug-Trace-0.05/t/stack.t --- old/Debug-Trace-0.04/t/stack.t 2002-10-16 12:22:49.000000000 +0200 +++ new/Debug-Trace-0.05/t/stack.t 2013-11-07 14:04:23.000000000 +0100 @@ -30,7 +30,8 @@ $msg = ""; $fl = __LINE__ + 1; x1("blah"); $msg =~ s/', '/','/g; # to match some older Carps -ok($msg,<<EOD); +$msg =~ s/", "/","/g; # to match some newer Carps +my $result = <<EOD; TRACE: main::x1("blah") called at @{[__FILE__]} line $fl package main TRACE: main::x2("a","b","c") called at @{[__FILE__]} line $l1 main::x1('blah') called at @{[__FILE__]} line $fl @@ -44,3 +45,9 @@ TRACE: main::x2() returned TRACE: main::x1() returned EOD + +# Newer Carp have a slightly different longmess output format. +use Carp (); +$result =~ s/\'/"/g if $Carp::VERSION >= 1.32; + +ok($msg,$result); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
