X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXDebug.pm;h=25d742250a6572037ee6f4589a2cf54a4bd4a53f;hb=dd01a8824f3896015e031cf301181760a6496bbd;hp=b0b723ce00f161b0464a7929507eb853ca6da513;hpb=bfd4e140dcf03f12bbda1dd405f8b135f86d0b6a;p=spider.git diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index b0b723ce..25d74225 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);