]> dxcluster.net Git - spider.git/commitdiff
Allow stuff on the console with no disk logging
authorDirk Koopman <djk@tobit.co.uk>
Sat, 23 May 2020 23:03:21 +0000 (00:03 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 23 May 2020 23:03:21 +0000 (00:03 +0100)
perl/DXDebug.pm

index c195fe2de01763f0025e655ab615dcd26799fe8e..25d742250a6572037ee6f4589a2cf54a4bd4a53f 100644 (file)
@@ -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 = '';