From d3329f07aa67cb53ca8ca96baf1c8a08e437e8f7 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Tue, 3 Oct 2017 08:53:09 -0700 Subject: [PATCH] discard quiet logs --- cmd/tile38-server/main.go | 3 +++ tests/mock_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/tile38-server/main.go b/cmd/tile38-server/main.go index 346e78e3..4bdf14be 100644 --- a/cmd/tile38-server/main.go +++ b/cmd/tile38-server/main.go @@ -141,6 +141,9 @@ func main() { flag.Parse() var logw io.Writer = os.Stderr + if quiet { + logw = ioutil.Discard + } log.SetOutput(logw) if quiet { log.Level = 0 diff --git a/tests/mock_test.go b/tests/mock_test.go index bbf13a68..14818fa6 100644 --- a/tests/mock_test.go +++ b/tests/mock_test.go @@ -49,7 +49,7 @@ func mockOpenServer() (*mockServer, error) { } core.DevMode = true s := &mockServer{port: port} - tlog.Default = tlog.New(logOutput, nil) + tlog.SetOutput(logOutput) go func() { if err := controller.ListenAndServe("localhost", port, dir, true); err != nil { log.Fatal(err)