projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
incoming now working
[spider.git]
/
perl
/
DXDebug.pm
diff --git
a/perl/DXDebug.pm
b/perl/DXDebug.pm
index ac452413555d4975dc3750bcaad5d120234fefaa..b55d01fcf5ea8de4fa060321e12195468274d8cc 100644
(file)
--- a/
perl/DXDebug.pm
+++ b/
perl/DXDebug.pm
@@
-21,7
+21,7
@@
use DXLog ();
use Carp qw(cluck);
%dbglevel = ();
use Carp qw(cluck);
%dbglevel = ();
-$fp =
DXLog::new('debug', 'dat', 'd')
;
+$fp =
undef
;
# Avoid generating "subroutine redefined" warnings with the following
# hack (from CGI::Carp):
# Avoid generating "subroutine redefined" warnings with the following
# hack (from CGI::Carp):
@@
-71,18
+71,21
@@
sub dbginit
$SIG{__WARN__} = sub { _store($@, Carp::shortmess(@_)); };
$SIG{__DIE__} = sub { _store($@, Carp::longmess(@_)); };
}
$SIG{__WARN__} = sub { _store($@, Carp::shortmess(@_)); };
$SIG{__DIE__} = sub { _store($@, Carp::longmess(@_)); };
}
+
+ $fp = DXLog::new('debug', 'dat', 'd');
}
sub dbgclose
{
$SIG{__DIE__} = $SIG{__WARN__} = 'DEFAULT';
}
sub dbgclose
{
$SIG{__DIE__} = $SIG{__WARN__} = 'DEFAULT';
- $fp->close();
+ $fp->close() if $fp;
+ undef $fp;
}
sub dbg
{
my $l = shift;
}
sub dbg
{
my $l = shift;
- if ($
dbglevel{$l} || $l eq 'err'
) {
+ if ($
fp && ($dbglevel{$l} || $l eq 'err')
) {
my @in = @_;
my $t = time;
for (@in) {
my @in = @_;
my $t = time;
for (@in) {