X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=run.go;h=3fd4168eef99a4f1feae35302af8abac03157d2e;hb=c252c75d3f44eac7ea7e88a062e41201cb2997e1;hp=816f962e25bc23a18f369872fc8730544078dd5a;hpb=734d81bb07d88fb293fefe6f9a0e75eb151dd555;p=goredo.git diff --git a/run.go b/run.go index 816f962..3fd4168 100644 --- a/run.go +++ b/run.go @@ -628,9 +628,11 @@ func runScript(tgt *Tgt, errs chan error, forced, traced bool) error { line = scanner.Text() if strings.HasPrefix(line, childStderrPrefix) { line = line[len(childStderrPrefix):] - LogMutex.Lock() - os.Stderr.WriteString(StderrPrefix + line + "\n") - LogMutex.Unlock() + if StderrPrefix == "" { + withPrependedTgt(line) + } else { + stderrWrite(StderrPrefix + line + "\n") + } continue } if fdStderr != nil { @@ -640,10 +642,13 @@ func runScript(tgt *Tgt, errs chan error, forced, traced bool) error { if StderrSilent { continue } - if MyPID == 0 { - tracef(CNone, "%s", line) + if MyPID != 0 { + line = pid + " " + line + } + if StderrPrefix == "" { + withPrependedTgt("[" + tgt.rel + "]" + line) } else { - tracef(CNone, "%s %s", pid, line) + stderrWrite(StderrPrefix + "[" + tgt.rel + "]" + line + "\n") } } close(stderrTerm)