X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXDebug.pm;h=c195fe2de01763f0025e655ab615dcd26799fe8e;hb=dd902a3e23aeb207178d9960f17b757262842ed6;hp=f5c1640196d459251235cd328ebecf40396a6f07;hpb=677f9d4ae7355cb6e5d05c3782a39e9022647f5b;p=spider.git diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index f5c16401..c195fe2d 100644 --- a/perl/DXDebug.pm +++ b/perl/DXDebug.pm @@ -85,7 +85,7 @@ if (!defined $DB::VERSION) { my $_isdbg; # current dbg level we are processing -sub dbg($) +sub dbg { return unless $fp; my $t = time; @@ -93,11 +93,11 @@ sub dbg($) my $r = $_; chomp $r; my @l = split /\n/, $r; - for (@l) { - s/([\x00-\x08\x0B-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg; - print "$_\n" if defined \*STDOUT && !$no_stdout; - my $tag = $_isdbg ? "($_isdbg) " : ''; - my $str = "$t^$tag$_"; + foreach my $l (@l) { + $l =~ s/([\x00-\x08\x0B-\x1f\x7f-\xff])/sprintf("%%%02X",ord($1))/eg; + print "$l\n" if defined \*STDOUT && !$no_stdout; + my $tag = $_isdbg ? "($_isdbg) " : '(*) '; + my $str = "$t^$tag$l"; &$callback($str) if $callback; if ($dbgringlth) { shift @dbgring while (@dbgring > $dbgringlth);