From: Dirk Koopman Date: Sat, 23 May 2020 23:03:21 +0000 (+0100) Subject: Allow stuff on the console with no disk logging X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef1b14d8b26228cacd68908b973d8eedc219975e;p=spider.git Allow stuff on the console with no disk logging --- diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index c195fe2d..25d74225 100644 --- a/perl/DXDebug.pm +++ b/perl/DXDebug.pm @@ -26,7 +26,7 @@ package DXDebug; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(dbginit dbg dbgadd dbgsub dbglist dbgdump isdbg dbgclose confess croak cluck); +@EXPORT = qw(dbginit dbg dbgadd dbgsub dbglist dbgdump isdbg dbgclose confess croak cluck carp); use strict; use vars qw(%dbglevel $fp $callback $cleandays $keepdays $dbgringlth); @@ -87,7 +87,7 @@ my $_isdbg; # current dbg level we are processing sub dbg { - return unless $fp; +# return unless $fp; my $t = time; for (@_) { my $r = $_; @@ -103,7 +103,7 @@ sub dbg shift @dbgring while (@dbgring > $dbgringlth); push @dbgring, $str; } - $fp->writeunix($t, $str) unless $dbglevel{"nolog$_isdbg"}; + $fp->writeunix($t, $str) unless !$fp || $dbglevel{"nolog$_isdbg"} ; } } $_isdbg = '';