Skip to content

Commit 075abd8

Browse files
Maisem Alimaisem
Maisem Ali
authored andcommitted
tstest: do not panic when a panic logs
The panicLogWriter is too strict, and any panics that occur get wrapped up in quotes. This makes it so that it will allow panics to continue writing to Stderr without going through logger.Logf. Updates #cleanup Signed-off-by: Maisem Ali <[email protected]>
1 parent 12a2221 commit 075abd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tstest/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (panicLogWriter) Write(b []byte) (int, error) {
4242
// interfaces.GetState & tshttpproxy code to allow pushing
4343
// down a Logger yet. TODO(bradfitz): do that refactoring once
4444
// 1.2.0 is out.
45-
if bytes.Contains(b, []byte("tshttpproxy: ")) {
45+
if bytes.Contains(b, []byte("tshttpproxy: ")) || bytes.Contains(b, []byte("runtime/panic.go:")) {
4646
os.Stderr.Write(b)
4747
return len(b), nil
4848
}

0 commit comments

Comments
 (0)