projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reduce ring buffer output on carp/cluck in DXDebug
[spider.git]
/
perl
/
DXDebug.pm
diff --git
a/perl/DXDebug.pm
b/perl/DXDebug.pm
index fcc60b86ded201972dbe8b9d7c7dd74a03f8b4ad..f249282e5b57e5d69399de8ece3cde3d5e1763f6 100644
(file)
--- a/
perl/DXDebug.pm
+++ b/
perl/DXDebug.pm
@@
-28,7
+28,7
@@
use 5.10.1;
require Exporter;
@ISA = qw(Exporter);
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(dbginit dbg dbgadd dbgsub dbglist dbgdump isdbg dbgclose dbgtrace confess croak cluck carp);
+@EXPORT = qw(dbginit dbg dbgadd dbgsub dbglist dbgdump isdbg dbgclose dbgtrace
dbgprintring
confess croak cluck carp);
use strict;
use vars qw(%dbglevel $fp $callback $cleandays $keepdays $dbgringlth);
use strict;
use vars qw(%dbglevel $fp $callback $cleandays $keepdays $dbgringlth);
@@
-69,12
+69,12
@@
if (!defined $DB::VERSION) {
exit(-1);
}
sub carp {
exit(-1);
}
sub carp {
- DXDebug::dbgprintring(
25) if DXDebu
g('nologchan');
+ DXDebug::dbgprintring(
5) if DXDebug::isdb
g('nologchan');
# DXDebug::dbg(Carp::shortmess(\@_));
DXDebug::longmess(\@_);
}
sub cluck {
# DXDebug::dbg(Carp::shortmess(\@_));
DXDebug::longmess(\@_);
}
sub cluck {
- DXDebug::dbgprintring(
25) if DXDebu
g('nologchan');
+ DXDebug::dbgprintring(
5) if DXDebug::isdb
g('nologchan');
# DXDebug::dbg(Carp::longmess(\@_));
DXDebug::longmess(\@_);
} );
# DXDebug::dbg(Carp::longmess(\@_));
DXDebug::longmess(\@_);
} );
@@
-104,7
+104,7
@@
sub dbgtrace
last if $pkg =~ /Mojo/;
# say "*** in dbgtrace $i after mojo";
$_isdbg = 'trace';
last if $pkg =~ /Mojo/;
# say "*** in dbgtrace $i after mojo";
$_isdbg = 'trace';
- dbg("Stack ($i): $
pkg
::$subr in $fn line: $l");
+ dbg("Stack ($i): $
{pkg}
::$subr in $fn line: $l");
}
$_isdbg = '';
}
}
$_isdbg = '';
}
@@
-135,6
+135,7
@@
sub dbg
sub dbginit
{
sub dbginit
{
+ my $basename = shift || 'debug';
$callback = shift;
# add sig{__DIE__} handling
$callback = shift;
# add sig{__DIE__} handling
@@
-161,7
+162,7
@@
sub dbginit
}
}
}
}
- $fp = DXLog::new(
'debug'
, 'dat', 'd');
+ $fp = DXLog::new(
$basename
, 'dat', 'd');
dbgclearring();
}
dbgclearring();
}