fix echo typo
[spider.git] / perl / DXCommandmode.pm
index d75d3a165b0f9d418584e35337196556a4cc8b1b..9d9f60b45e90b199fda5f5c4246d064d8ef1e412 100644 (file)
@@ -544,19 +544,16 @@ sub run_cmd
                        if ($package && $self->can("${package}::handle")) {
                                no strict 'refs';
                                dbg("cmd: package $package") if isdbg('command');
-                               if (isdbg('progress')) {
-                                       my $s = "CMD: '$cmd' by $call ip $self->{hostname}";
-                               }
                                my $t0 = [gettimeofday];
                                eval { @ans = &{"${package}::handle"}($self, $args) };
                                if ($@) {
-                                       dbgprintring(25);
+                                       DXDebug::dbgprintring(25);
                                        return (DXDebug::shortmess($@));
                                }
                                if (isdbg('progress')) {
                                        my $msecs = _diffms($t0);
                                        my $s = "CMD: '$cmd $args' by $call ip: $self->{hostname} ${msecs}mS";
-                                       dbg($s);
+                                       dbg($s) if $cmd !~ /^(?:echo|blank)/ || isdbg('echo');     # cut down a bit on HRD and other clients' noise
                                }
                        } else {
                                dbg("cmd: $package not present") if isdbg('command');
@@ -1326,8 +1323,8 @@ sub spawn_cmd
                         sub {
                                 my $subpro = shift;
                                 if (isdbg('progress')) {
-                                        my $s = "line: $line";
-                                        $s .= ", args: " . join(', ', @$args) if $args && @$args;
+                                        my $s = qq{line: "$line"};
+                                        $s .= ", args: " . join(', ', map { defined $_ ? qq{'$_'} : q{'undef'} } @$args) if $args && @$args;
                                         dbg($s);
                                 }
                                 eval { @out = $cmdref->(@$args); };