Author: timbo
Date: Tue Mar 9 06:01:40 2004
New Revision: 203
Modified:
dbi/trunk/lib/DBI/PurePerl.pm
Log:
Use carp::shortmess to add stack trace info to DBI::PurePerl at tracel level >=2
Modified: dbi/trunk/lib/DBI/PurePerl.pm
==============================================================================
--- dbi/trunk/lib/DBI/PurePerl.pm (original)
+++ dbi/trunk/lib/DBI/PurePerl.pm Tue Mar 9 06:01:40 2004
@@ -280,12 +280,14 @@
my @post_call_frag;
push @post_call_frag, q{
- if ($DBI::dbi_debug & 0xF) {
+ if (my $trace_level = ($DBI::dbi_debug & 0xF)) {
if ($h->{err}) {
printf $DBI::tfh " !! ERROR: %s %s\n", $h->{err}, $h->{errstr};
}
my $ret = join " ", map { DBI::neat($_) } @ret;
- printf $DBI::tfh " < $method_name= %s\n", $ret;
+ my $msg = " < $method_name= $ret";
+ $msg = ($trace_level >= 2) ? Carp::shortmess($msg) : "$msg\n";
+ print $DBI::tfh $msg;
}
} if exists $ENV{DBI_TRACE}; # note use of exists