itest: replace fakeLogger with v2 logger with Discard

This commit is contained in:
yyforyongyu 2021-09-16 04:24:48 +08:00
parent 403fdaa716
commit 05ac516762
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -139,17 +139,6 @@ func (n *NetworkHarness) ProcessErrors() <-chan error {
return n.lndErrorChan
}
// fakeLogger is a fake grpclog.Logger implementation. This is used to stop
// grpc's logger from printing directly to stdout.
type fakeLogger struct{}
func (f *fakeLogger) Fatal(args ...interface{}) {}
func (f *fakeLogger) Fatalf(format string, args ...interface{}) {}
func (f *fakeLogger) Fatalln(args ...interface{}) {}
func (f *fakeLogger) Print(args ...interface{}) {}
func (f *fakeLogger) Printf(format string, args ...interface{}) {}
func (f *fakeLogger) Println(args ...interface{}) {}
// SetUp starts the initial seeder nodes within the test harness. The initial
// node's wallets will be funded wallets with ten 1 BTC outputs each. Finally
// rpc clients capable of communicating with the initial seeder nodes are
@ -160,7 +149,8 @@ func (n *NetworkHarness) SetUp(t *testing.T,
// Swap out grpc's default logger with out fake logger which drops the
// statements on the floor.
grpclog.SetLogger(&fakeLogger{})
fakeLogger := grpclog.NewLoggerV2(io.Discard, io.Discard, io.Discard)
grpclog.SetLoggerV2(fakeLogger)
n.currentTestCase = testCase
// Start the initial seeder nodes within the test network, then connect