mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
59b63caf5e
Whoa, one more big commit. I didn't manage to untangle the changes while working towards compatibility.
29 lines
514 B
Go
29 lines
514 B
Go
package p2p
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ethereum/go-ethereum/logger"
|
|
)
|
|
|
|
type testLogger struct{ t *testing.T }
|
|
|
|
func testlog(t *testing.T) testLogger {
|
|
logger.Reset()
|
|
l := testLogger{t}
|
|
logger.AddLogSystem(l)
|
|
return l
|
|
}
|
|
|
|
func (testLogger) GetLogLevel() logger.LogLevel { return logger.DebugLevel }
|
|
func (testLogger) SetLogLevel(logger.LogLevel) {}
|
|
|
|
func (l testLogger) LogPrint(level logger.LogLevel, msg string) {
|
|
l.t.Logf("%s", msg)
|
|
}
|
|
|
|
func (testLogger) detach() {
|
|
logger.Flush()
|
|
logger.Reset()
|
|
}
|