From ef1b14d8b26228cacd68908b973d8eedc219975e Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sun, 24 May 2020 00:03:21 +0100 Subject: [PATCH] Allow stuff on the console with no disk logging --- perl/DXDebug.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 = ''; -- 2.43.0