magicsock/test: oops, fix a data race in nested-test logf hack.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
Avery Pennarun
2020-05-13 23:44:58 -04:00
parent 42a0e0c601
commit 4f128745d8
3 changed files with 43 additions and 29 deletions

View File

@@ -34,7 +34,7 @@ func main() {
logger := logtail.Log(logtail.Config{
Collection: *collection,
PrivateID: id,
})
}, log.Printf)
log.SetOutput(io.MultiWriter(logger, os.Stdout))
defer logger.Flush()
defer log.Printf("logtail exited")