From 075abd8ec17ce44f589c163bbe093f12e69de44c Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Wed, 28 Jun 2023 13:08:44 -0700 Subject: [PATCH] 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 --- tstest/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tstest/log.go b/tstest/log.go index 683d446fb..fe309d1df 100644 --- a/tstest/log.go +++ b/tstest/log.go @@ -42,7 +42,7 @@ func (panicLogWriter) Write(b []byte) (int, error) { // interfaces.GetState & tshttpproxy code to allow pushing // down a Logger yet. TODO(bradfitz): do that refactoring once // 1.2.0 is out. - if bytes.Contains(b, []byte("tshttpproxy: ")) { + if bytes.Contains(b, []byte("tshttpproxy: ")) || bytes.Contains(b, []byte("runtime/panic.go:")) { os.Stderr.Write(b) return len(b), nil }