mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
functional: silence http server logs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
1d18f45caf
commit
e7e31e9529
@ -19,6 +19,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -191,8 +193,9 @@ $ ETCDCTL_API=3 ./bin/etcdctl --endpoints localhost:23790 put foo bar`)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: fmt.Sprintf(":%d", httpPort),
|
Addr: fmt.Sprintf(":%d", httpPort),
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
|
ErrorLog: log.New(ioutil.Discard, "net/http", 0),
|
||||||
}
|
}
|
||||||
defer srv.Close()
|
defer srv.Close()
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -106,8 +107,9 @@ func NewCluster(lg *zap.Logger, fpath string) (*Cluster, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clus.testerHTTPServer = &http.Server{
|
clus.testerHTTPServer = &http.Server{
|
||||||
Addr: clus.Tester.Addr,
|
Addr: clus.Tester.Addr,
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
|
ErrorLog: log.New(ioutil.Discard, "net/http", 0),
|
||||||
}
|
}
|
||||||
go clus.serveTesterServer()
|
go clus.serveTesterServer()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user