discard quiet logs

This commit is contained in:
Josh Baker 2017-10-03 08:53:09 -07:00
parent 8d5f447e3e
commit d3329f07aa
2 changed files with 4 additions and 1 deletions

View File

@ -141,6 +141,9 @@ func main() {
flag.Parse() flag.Parse()
var logw io.Writer = os.Stderr var logw io.Writer = os.Stderr
if quiet {
logw = ioutil.Discard
}
log.SetOutput(logw) log.SetOutput(logw)
if quiet { if quiet {
log.Level = 0 log.Level = 0

View File

@ -49,7 +49,7 @@ func mockOpenServer() (*mockServer, error) {
} }
core.DevMode = true core.DevMode = true
s := &mockServer{port: port} s := &mockServer{port: port}
tlog.Default = tlog.New(logOutput, nil) tlog.SetOutput(logOutput)
go func() { go func() {
if err := controller.ListenAndServe("localhost", port, dir, true); err != nil { if err := controller.ListenAndServe("localhost", port, dir, true); err != nil {
log.Fatal(err) log.Fatal(err)