diff --git a/.gitignore b/.gitignore index c3b575637..4d0438520 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ make_config.mk logs/ lib/ output/ +*.log # DB db/ diff --git a/tests/util/pikiwidb.go b/tests/util/pikiwidb.go index 28518b55a..3d53aa48e 100644 --- a/tests/util/pikiwidb.go +++ b/tests/util/pikiwidb.go @@ -145,8 +145,15 @@ func StartServer(config string, options map[string]string, delete bool) *Server b := getBinPath() c := exec.Command(b) - c.Stdout = os.Stdout - c.Stderr = os.Stderr + outfile, err := os.Create("test.log") + if err != nil { + panic(err) + } + defer outfile.Close() + + c.Stdout = outfile + c.Stderr = outfile + log.SetOutput(outfile) if len(config) != 0 { t := time.Now().UnixMilli() @@ -182,7 +189,7 @@ func StartServer(config string, options map[string]string, delete bool) *Server p, _ = strconv.Atoi(options["port"]) } - err := c.Start() + err = c.Start() if err != nil { log.Println("pikiwidb startup failed.", err.Error()) return nil